ammo bug weapon not switching
#1

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.
Reply
#2

Use SetPlayerAmmo.
https://sampwiki.blast.hk/wiki/SetPlayerAmmo
Reply
#3

@Golden thanks for the reply but should I exactly put it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)