Removing baseball bat

At a spawn players get baseball bats, but I made a command that should remove the baseball bat, but it doesn't.
Se here is what I tried:
SetPlayerAmmo(playerid, 1, 0);
GivePlayerWeapon(playerid, 5, -1);

But the bat is still here :/
How can I remove it?
Next thing that I can think of is saving all weapons and ResetPlayerWeapons(playerid); but I don't want to do it, really.

Change the AddPlayerClass(...);, so it doesn't give the weapon.

No good, there are other weapons like theese and those shouldn't be removed from spawn.

Originally Posted by potato
No good, there are other weapons like theese and those shouldn't be removed from spawn.
Only remove the baseball bat then-_-

Ok, will try to explain more, if you don't get this.
I said I can't simply remove the bat because there are other weapons like that, that means there are weapons which aren't given to the spawn.
For some reasons theese 2 functions with that amount of ammo doesn't work, so maybe there is a trick that could remove them?
Not sure, but could be a weapon that goes in the WeaponSlot 1 which has bullets, that way I could set it's ammo to 0 zero and the weapon will disappear, but that doesn't happen to weapons that doesn't have bullets.

This might work

pawn Код:
new weapons[12][2];
    for (new i = 0; i < 13; i++)
         GetPlayerWeaponData(playerid, i, weapons[i][0]/*weapon id*/, weapons[i][1]/*ammo*/);


    for (i = 0; i < 13; i++)
         if(weapons[i][0]!= /*bat weapon id*/)
              GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
              return 0;

Thanks, but bit too late.
I got p*ssed off because of the baseball bat thing not working that I made a weapon saving system and then gave the weapons back after ResetPlayerWeapons(playerid);
I found out that Baseball bats has 65535 bullets.
So now there is no baseball bat :P
But thanks for the reply, others might need such a weapon saving script, could save weapons in a file or mysql (like I do).

Forum Jump:

Users browsing this thread: