I have just started to work with ZP, and a lot has changed from 4.3 to 5.0. But that's not really relevant here.
What I want to do, when a user buys an item, is that I want to strip all his weapons, and then give them all back to him but the primary one since he bought a new one.
Maybe there is an easier way to do it. I found a stock:
PHP Code:
stock drop_prim(id)
{
new weapons[32], num
get_user_weapons(id, weapons, num)
for (new i = 0; i < num; i++)
{
if (Wep_ak47 & (1<<weapons[i]))
{
static wname[32]
get_weaponname(weapons[i], wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
But that one just throws the weapons on the ground, they can be picked up by anyone when that code has been executed.
Any ideas?
__________________