ammo bug weapon not switching - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ammo bug weapon not switching (
/showthread.php?tid=612320)
ammo bug weapon not switching -
kampuman - 16.07.2016
Basically I have weapons script running on my server.
Now, going ingame after spawning different kinds of weapons. My weapon deagle and silenced pistol got stuck and the weapon cannot be equipped because it switch too fast like a bug.
I was wondering it could be an ammo bug because on the script there's no resetting ammo limit.
Код:
if(listitem == 1)
{
format(gsQuery,sizeof(gsQuery),"UPDATE `accounts` SET `weap4` = '23' WHERE `Key` = '%d'",PlayerInfo[ playerid ][ AccID ]);
mysql_query( gsQuery, THREAD_NONE, playerid );
PlayerInfo[ playerid ][ weap4 ] = 23;
GivePlayerWeapon( playerid, PlayerInfo[ playerid ][ weap4 ], 0x7FFFFFFF);
}
if(listitem == 2)
{
format(gsQuery,sizeof(gsQuery),"UPDATE `accounts` SET `weap4` = '24' WHERE `Key` = '%d'",PlayerInfo[ playerid ][ AccID ]);
mysql_query( gsQuery, THREAD_NONE, playerid );
PlayerInfo[ playerid ][ weap4 ] = 24;
GivePlayerWeapon( playerid, PlayerInfo[ playerid ][ weap4 ], 0x7FFFFFFF);
}
It got bugged after spawning the same weapon many times.
So can someone please help me give a simple reset ammo weawpon without deleting the whole set of your weapons.
Re: ammo bug weapon not switching -
GoldenLion - 16.07.2016
Use SetPlayerAmmo.
https://sampwiki.blast.hk/wiki/SetPlayerAmmo
Re: ammo bug weapon not switching -
kampuman - 16.07.2016
@Golden thanks for the reply but should I exactly put it?