still, if i type amx_instagibweapon, i get ak47. it depends on the first weapon i would like to give: if it is
Code:
if(equali(weap , "ak47"))
{
give_item(id , "weapon_ak47");
cs_set_user_bpammo(id , CSW_AK47 , 90);
return PLUGIN_HANDLED;
}
, amx_instagibweapon is ak47, if it is:
Code:
if(equali(weap , "usp"))
{
give_item(id , "weapon_usp");
cs_set_user_bpammo(id , CSW_USP , 90);
return PLUGIN_HANDLED;
}
, amx_instagibweapon is usp.
also, i made the code look like this now:
Code:
public GiveWeapon(id) {
if( get_cvar_num( "amx_instagib" ) != 1 ) {
return PLUGIN_HANDLED
}
new players[32],num,i,id,cvar,ak47,usp
get_players(players,num)
for(i = 0; i <= num; i++) {
id = players[i]
if(is_user_alive(id)) {
new weap[21]
get_cvar_string("amx_instagibweapon" , weap , 20)
if(equali(weap , "usp"))
{
give_item(id , "weapon_usp")
cs_set_user_bpammo(id , CSW_USP, 90)
return PLUGIN_HANDLED
}
if(equali(weap , "ak47"))
{
give_item(id , "weapon_ak47")
cs_set_user_bpammo(id , CSW_AK47 , 90)
return PLUGIN_HANDLED
}
}
}
return PLUGIN_CONTINUE
}
server crashes.
EDIT: there's no problem, my mistake!