Jump to content

[REZOLVAT] Cerere plugin arunca arma


PiColo

Recommended Posts

#include <amxmodx>

#include <cstrike>

#include <fun>

#include <hamsandwich>

 

 

#define PLUGIN    "Furien WEAPON MENU" 

#define AUTHOR    "BlueSky" 

#define VERSION    "1.0" 

#pragma semicolon 1

 

public plugin_init()

{

register_plugin(PLUGIN, VERSION, AUTHOR);

RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1);

RegisterHam(Ham_Touch, "weaponbox", "Player_Touchweapon");

RegisterHam(Ham_Touch, "armoury_entity", "Player_Touchweapon");

}

public Player_Touchweapon(const id)

{

if(!is_user_alive(id) || is_user_bot(id))

return HAM_IGNORED;

 

new CsTeams:team = cs_get_user_team(id);

 

if(team == CS_TEAM_T)

return HAM_SUPERCEDE;

 

return HAM_IGNORED;

}

public Player_Spawn(id)

{

if(!is_user_alive(id) || is_user_bot(id))

return PLUGIN_HANDLED;

 

 

new CsTeams:team = cs_get_user_team(id);

switch(team)

{

case CS_TEAM_T:

{

strip_user_weapons(id);

give_item(id, "weapon_knife");

give_item(id, "weapon_hegrenade");

give_item(id, "weapon_smokegrenade");

give_item(id, "weapon_flashbang");

give_item(id, "weapon_flashbang");

}

case CS_TEAM_CT:

{

strip_user_weapons(id);

give_item(id, "weapon_deagle");

 

give_item(id, "weapon_flashbang");

give_item(id, "weapon_flashbang");

give_item(id, "weapon_smokegrenade");

give_item(id, "weapon_knife");

cs_set_user_bpammo(id,CSW_DEAGLE,250); 

new menu = menu_create("Alegeti o arma", "menu_handler"); 

 

menu_additem(menu, "M4A1", "1", 0); 

menu_additem(menu, "AK47", "2", 0); 

menu_additem(menu, "MP5 Navy", "3", 0); 

menu_additem(menu, "XM1014", "4", 0);   

menu_additem(menu, "GALIL", "5", 0);  

menu_additem(menu, "FAMAS", "6", 0); 

 

 

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); 

 

menu_display(id, menu, 0); 

 

}

}

return PLUGIN_HANDLED;

}

public menu_handler(id, menu, item) 


if( item == MENU_EXIT ) 


menu_destroy(menu); 

return PLUGIN_HANDLED; 


new data[6], iName[64]; 

new access, callback; 

menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); 

new key = str_to_num(data); 

 

switch(key) 


case 1: 


give_item(id, "weapon_m4a1");

cs_set_user_bpammo(id,CSW_M4A1,250); 

 


case 2: 


give_item(id, "weapon_ak47");

cs_set_user_bpammo(id,CSW_AK47,250);   

 


case 3:   


give_item(id, "weapon_mp5navy");

cs_set_user_bpammo(id,CSW_MP5NAVY,250); 

 


case 4:   


give_item(id, "weapon_xm1014");

cs_set_user_bpammo(id,CSW_XM1014,250);   

 


case 5:   


give_item(id, "weapon_galil"); 

cs_set_user_bpammo(id,CSW_GALIL,250);   

 


case 6:   


 

give_item(id, "weapon_famas"); 

cs_set_user_bpammo(id,CSW_FAMAS,250);   

 


 

}

 

 

menu_destroy(menu); 

return PLUGIN_HANDLED; 

}

Edited by Macit Arcaoglu
Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...