I was in the process of updating Admin All in One commands to use weapon names instead of numbers for the weapons plugin that was included.
Well lets get down to business, the problem I am having is when I change them to weapon names, it only gives me a usp, no matter what weapon I issue a command for it gives a usp everytime.
Code:
new usp, glock, deagle, p228, elite, fiveseven, pumpshotty, autoshotty, mp5, tmp, p90, mac10, ump45, flashbang,
ak, m4, sg552, bullup, scout, awp, sg550, g3sg1, machine_gun, kevlar, assaultsuit, grenade, smokenade, defuser
//Pistols
if (weapon_give == usp){
give_item(victim_index,"weapon_usp")
give_item(victim_index,"ammo_45acp")
give_item(victim_index,"ammo_45acp")
give_item(victim_index,"ammo_45acp")
give_item(victim_index,"ammo_45acp")
give_item(victim_index,"ammo_45acp")
give_item(victim_index,"ammo_45acp")
give_item(victim_index,"ammo_45acp")
give_item(victim_index,"ammo_45acp")
}
else if (weapon_give == glock){
give_item(victim_index,"weapon_glock18")
give_item(victim_index,"ammo_9mm")
give_item(victim_index,"ammo_9mm")
give_item(victim_index,"ammo_9mm")
give_item(victim_index,"ammo_9mm")
give_item(victim_index,"ammo_9mm")
give_item(victim_index,"ammo_9mm")
give_item(victim_index,"ammo_9mm")
give_item(victim_index,"ammo_9mm")
}
else if (weapon_give == deagle){
give_item(victim_index,"weapon_deagle")
give_item(victim_index,"ammo_50ae")
give_item(victim_index,"ammo_50ae")
give_item(victim_index,"ammo_50ae")
give_item(victim_index,"ammo_50ae")
give_item(victim_index,"ammo_50ae")
give_item(victim_index,"ammo_50ae")
give_item(victim_index,"ammo_50ae")
}
Now if I changed those names back to numbers it would like its intended to, I am confused, I tired all kinds of things and now I ask for help
that would give me a glock under the number system that worked, with the name system it would give a usp if I used