23.11.2013, 15:21
Quote:
I'm not sure about that. If you have a deagle with 500 ammo and you give 0, you should still have 500 ammo.
Anyways, I'd save the weapons/ammo in an array with GetPlayerWeaponData and if the weaponid existed, I'd reset the weapons and give them back except the weaponid you chose (note that you should know the slot of the weapon). |
pawn Code:
stock RemovePlayerWeaponID(playerid, weaponid)
{
new
ArrayWeapons[12], ArrayAmmunations[12], Weapon, Ammunation;
for(new slot = 0; slot != 12; slot++) {
GetPlayerWeaponData(playerid, slot, Weapon, Ammunation);
if(Weapon != weaponid) {
GetPlayerWeaponData(playerid, slot, ArrayWeapons[slot], ArrayAmmunations[slot]);
}
}
for(new slot = 0; slot != 12; slot++) {
GivePlayerWeapon(playerid, ArrayWeapons[slot], 300);
}
ResetPlayerWeapons(playerid);
}