17.07.2011, 22:04
I'm making a rent weapon system and I need to know how to drop a certain weapon instead of all of them.
stock RemovePlayerWeapon(playerid, weaponid) {
new Weapons[12], Ammo[12];
for(new slot=0; slot !=12;++slot) {
new weapon, ammo;
GetPlayerWeaponData(playerid, slot, weapon, ammo);
if(weapon !=weaponid && ammo !=0) {
GetPlayerWeaponData(playerid, slot, Weapons[slot], Ammo[slot]);
}
}
ResetPlayerWeapons(playerid);
for(new slot =0; slot !=12;++slot) {
if(Ammo[slot] != 0) {
GivePlayerWeapon(playerid, Weapons[slot], Ammo[slot]);
}
return 1;
}