This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Request plugin correct


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 01-13-2016 , 14:48   Request plugin correct
Reply With Quote #1

hello guys , with this plugin i cant peek up weapons on floor , please fix :c

#edit
When i got a weapon , next round the weapon just dissapear

but the other bug still happening

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>

/*--------[Constants]--------*/

#define PLUGIN "Weapons Menu"
#define VERSION "1.0"
#define AUTHOR "Hedgehog Fog"

#define MAX_PLAYERS 32

enum _:Data
{
  
_name[32],
  
_csw[32],
  
_wname[32],
  
_ammo[32]
};

new const 
g_menuTitle[] = "\r[ SMART TEAM PORTUGAL ]y^nVIP GRATIS^ndEscolhe a tua arma!";

new const 
g_weapons[][Data]=
{
  {
"M4A1"CSW_M4A1"weapon_m4a1"90},
  {
"AK47"CSW_AK47"weapon_ak47"90}
};

new 
g_roundNum;
new 
g_menu;
new 
bool:g_equipUser[MAX_PLAYERS+1];
new 
bool:g_isRestart;

/*--------[Init]--------*/

public plugin_init()
{
  
register_plugin(PLUGINVERSIONAUTHOR);

  
//New round hook
  
register_event("HLTV""onNewRound""a""2=0""3=0");

  
//Game restart hook
  
register_event("TextMsg""onGameRestart""a""2=#Game_Commencing");
  
register_event("TextMsg""onGameRestart""a""2=#Game_will_restart_in");

  
//Player Events hook
  
RegisterHam(Ham_Spawn"player""onPlayerSpawn"1);
  
RegisterHam(Ham_Killed"player""onPlayerKilled"1);

  
menu_init();
}

/*--------[Events]--------*/

public onPlayerKilled(id)
{
  
g_equipUser[id] = true;
}

public 
onPlayerSpawn(id)
{
  if(!
is_user_alive(id))
    return;

  if(
g_equipUser[id] || !g_roundNum)
  {
    
equip_user(id);
    
g_equipUser[id] = false;
  }

  if(
get_playersnum() > && g_roundNum >= 2)
    
menu_display(idg_menu0);
}

public 
onNewRound()
{
  if(!
g_isRestart)
    
g_roundNum++;
  else
    
g_isRestart false;
}

public 
onGameRestart()
{
  
g_isRestart true;
  
g_roundNum 0;
}

/*--------[Menu]--------*/

public menu_init()
{
  
g_menu menu_create(g_menuTitle"menu_handler");

  for(new 
0sizeof(g_weapons); i++)
  {
    new 
text[64];
    
formatex(textcharsmax(text), "Quero %s + Deagle"g_weapons[i][_name]);
    
menu_additem(g_menutext""0);
  }
}

public 
menu_handler(idmenuitem)
{
  if(
item == MENU_EXIT)
    return 
PLUGIN_HANDLED;

  if(!
is_user_alive(id))
    return 
PLUGIN_HANDLED;

  
equip_user(id);
  
give_item(idg_weapons[item][_wname]);
  
cs_set_user_bpammo(idg_weapons[item][_csw], g_weapons[item][_ammo]);

  return 
PLUGIN_HANDLED;
}

/*--------[Equip]--------*/

equip_user(id)
{
  new 
bool:giveC4 = !!(user_has_weapon(idCSW_C4));

  
strip_user_weapons(id);

  
give_item(id"weapon_knife");

  
give_item(id"weapon_deagle");

  
give_item(id"weapon_hegrenade");
  
give_item(id"weapon_flashbang");
  
give_item(id"weapon_flashbang");
  
give_item(id"weapon_smokegrenade");

  
give_item(id"item_assaultsuit");
  
give_item(id"item_thighpack");

  
cs_set_user_bpammo(idCSW_DEAGLE35);

  if(
giveC4)
  {
    
give_item(id"weapon_c4");
    
cs_set_user_plant(id1);
  }


Last edited by JoaoVieira; 01-15-2016 at 10:03.
JoaoVieira is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 01-13-2016 , 16:03   Re: Request plugin correct
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>

/*--------[Constants]--------*/

#define PLUGIN "Weapons Menu"
#define VERSION "1.0"
#define AUTHOR "Hedgehog Fog"

#define MAX_PLAYERS 32

enum _:Data
{
  
_name[32],
  
_csw[32],
  
_wname[32],
  
_ammo[32]
};

new const 
g_menuTitle[] = "\r[ SMART TEAM PORTUGAL ]y^nVIP GRATIS^ndEscolhe a tua arma!";

new const 
g_weapons[][Data]=
{
  {
"M4A1"CSW_M4A1"weapon_m4a1"90},
  {
"AK47"CSW_AK47"weapon_ak47"90}
};

new 
g_roundNum;
new 
g_menu;
new 
bool:g_equipUser[MAX_PLAYERS+1];
new 
bool:g_isRestart;

/*--------[Init]--------*/

public plugin_init()
{
  
register_plugin(PLUGINVERSIONAUTHOR);

  
//New round hook
  
register_event("HLTV""onNewRound""a""2=0""3=0");

  
//Game restart hook
  
register_event("TextMsg""onGameRestart""a""2=#Game_Commencing");
  
register_event("TextMsg""onGameRestart""a""2=#Game_will_restart_in");

  
//Player Events hook
  
RegisterHam(Ham_Spawn"player""onPlayerSpawn"1);
  
RegisterHam(Ham_Killed"player""onPlayerKilled"1);

  
menu_init();
}

/*--------[Events]--------*/

public onPlayerKilled(id)
{
  
g_equipUser[id] = true;
}

public 
onPlayerSpawn(id)
{
  if(!
is_user_alive(id))
    return;

  if(
g_equipUser[id] || !g_roundNum)
  {
    
equip_user(id);
    
g_equipUser[id] = false;
  }

  if(
get_playersnum() > && g_roundNum >= 2)
    
menu_display(idg_menu0);
}

public 
onNewRound()
{
  if(!
g_isRestart)
    
g_roundNum++;
  else
    
g_isRestart false;
}

public 
onGameRestart()
{
  
g_isRestart true;
  
g_roundNum 0;
}

/*--------[Menu]--------*/

public menu_init()
{
  
g_menu menu_create(g_menuTitle"menu_handler");

  for(new 
0sizeof(g_weapons); i++)
  {
    new 
text[64];
    
formatex(textcharsmax(text), "Quero %s + Deagle"g_weapons[i][_name]);
    
menu_additem(g_menutext""0);
  }
}

public 
menu_handler(idmenuitem)
{
  if(
item == MENU_EXIT)
    return 
PLUGIN_HANDLED;

  if(!
is_user_alive(id))
    return 
PLUGIN_HANDLED;

  
equip_user(id);
  
give_item(idg_weapons[item][_wname]);
  
cs_set_user_bpammo(idg_weapons[item][_csw], g_weapons[item][_ammo]);

  return 
PLUGIN_HANDLED;
}

/*--------[Equip]--------*/

equip_user(id)
{
  new 
bool:giveC4 = !!(user_has_weapon(idCSW_C4));

  
strip_user_weapons(id);

  
give_item(id"weapon_knife");

  
give_item(id"weapon_deagle");

  
give_item(id"weapon_hegrenade");
  
give_item(id"weapon_flashbang");
  
give_item(id"weapon_flashbang");
  
give_item(id"weapon_smokegrenade");

  
give_item(id"item_assaultsuit");
  
give_item(id"item_thighpack");

  
cs_set_user_bpammo(idCSW_DEAGLE35);

  if(
giveC4)
  {
    
give_item(id"weapon_c4");
    
cs_set_user_plant(id1);
  }


Last edited by Hedgehog Fog; 01-13-2016 at 17:35.
Hedgehog Fog is offline
Old 01-13-2016, 16:05
JoaoVieira
This message has been deleted by JoaoVieira.
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 01-13-2016 , 16:07   Re: Request plugin correct
Reply With Quote #3

JoaoVieira
Remove the quotation please.
I fix some problem. Updated.
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 01-13-2016 at 16:20.
Hedgehog Fog is offline
Old 01-13-2016, 16:08
JoaoVieira
This message has been deleted by JoaoVieira.
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 01-13-2016 , 16:10   Re: Request plugin correct
Reply With Quote #4

JoaoVieira
Stop quoting my posts please. Just remove qoute tag.
Sometimes I edit my posts.
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 01-13-2016 at 16:18.
Hedgehog Fog is offline
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 01-13-2016 , 16:28   Re: Request plugin correct
Reply With Quote #5

Dude , where is a small error .

my caracter drop deagle , ak and the bomb , if u correct that , it will be great :p
JoaoVieira is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 01-13-2016 , 16:33   Re: Request plugin correct
Reply With Quote #6

JoaoVieira
You want a player could not drop weapon?
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities
Hedgehog Fog is offline
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 01-13-2016 , 16:35   Re: Request plugin correct
Reply With Quote #7

Quote:
Originally Posted by Hedgehog95 View Post
JoaoVieira
You want a player could not drop weapon?
I want this :

Player get ak deagle nades , and the bomb fix and not drop them

'-'
JoaoVieira is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 01-13-2016 , 16:37   Re: Request plugin correct
Reply With Quote #8

JoaoVieira
Drop what?

Default player equipment replaced to deagle, knife, grenades and armor. After 2 rounds player can select primary weapon from menu. What do you want?
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 01-13-2016 at 16:38.
Hedgehog Fog is offline
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 01-13-2016 , 16:38   Re: Request plugin correct
Reply With Quote #9

Quote:
Originally Posted by Hedgehog95 View Post
JoaoVieira
Drop what?
don't drop the ak deagle granades and bomb
JoaoVieira is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 01-13-2016 , 16:40   Re: Request plugin correct
Reply With Quote #10

JoaoVieira
You want block a weapon drop?
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities
Hedgehog Fog is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode