At the top of your script with all the #defines add this....
then just for your script do this
pawn Код:
stock RemovePlayerWeapon(playerid, weaponid)
{
if(GetPlayerWeapon(playerid) == WEAPON_GRENADE)
{
SetPlayerAmmo(playerid, WEAPON_GRENADE, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_TEARGAS)
{
SetPlayerAmmo(playerid, WEAPON_TEARGAS, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_MOLTOV)
{
SetPlayerAmmo(playerid, WEAPON_MOLTOV, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_COLT45)
{
SetPlayerAmmo(playerid, WEAPON_COLT45, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_SILENCED)
{
SetPlayerAmmo(playerid, WEAPON_SILENCED, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_DEAGLE)
{
SetPlayerAmmo(playerid, WEAPON_DEAGLE, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_SHOTGUN)
{
SetPlayerAmmo(playerid, WEAPON_SHOTGUN, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_SAWEDOFF)
{
SetPlayerAmmo(playerid, WEAPON_SHOTGSPA, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_UZI)
{
SetPlayerAmmo(playerid, WEAPON_UZI, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_MP5)
{
SetPlayerAmmo(playerid, WEAPON_MP5, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_AK47)
{
SetPlayerAmmo(playerid, WEAPON_AK47, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_M4)
{
SetPlayerAmmo(playerid, WEAPON_M4, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_TEC9)
{
SetPlayerAmmo(playerid, WEAPON_TEC9, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_RIFLE)
{
SetPlayerAmmo(playerid, WEAPON_RIFLE, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_SNIPER)
{
SetPlayerAmmo(playerid, WEAPON_SNIPER, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_ROCKETLAUNCHER)
{
SetPlayerAmmo(playerid, WEAPON_ROCKETLAUNCHER, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_HEATSEEKER)
{
SetPlayerAmmo(playerid, WEAPON_HEATSEEKER, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_FLAMETHROWER)
{
SetPlayerAmmo(playerid, WEAPON_FLAMETHROWER, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN)
{
SetPlayerAmmo(playerid, WEAPON_MINIGUN, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_SATCHEL)
{
SetPlayerAmmo(playerid, WEAPON_SATCHEL, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_BOMB)
{
SetPlayerAmmo(playerid, WEAPON_BOMB, AMMO);
}
else if(GetPlayerWeapon(playerid) == WEAPON_SPRAYCAN)
{
SetPlayerAmmo(playerid, WEAPON_SPRAYCAN, AMMO);
}
return 1;
}