Removing baseball bat -
potato - 15.06.2009
Hi!
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.
Re: Removing baseball bat -
ettans - 15.06.2009
Change the AddPlayerClass(...);, so it doesn't give the weapon.
Re: Removing baseball bat -
potato - 15.06.2009
No good, there are other weapons like theese and those shouldn't be removed from spawn.
Re: Removing baseball bat -
robanswe - 15.06.2009
Quote:
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-_-
Re: Removing baseball bat -
potato - 15.06.2009
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.
Re: Removing baseball bat -
dice7 - 15.06.2009
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*/);
}
ResetPlayerWeapons(playerid);
for (i = 0; i < 13; i++)
{
if(weapons[i][0]!= /*bat weapon id*/)
{
GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
}
else
{
return 0;
}
}
Re: Removing baseball bat -
potato - 15.06.2009
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).