SA-MP Forums Archive
Tazer 1 bullet ! HELP - 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: Tazer 1 bullet ! HELP (/showthread.php?tid=607083)



Tazer 1 bullet ! HELP - D3vin - 14.05.2016

okay so, this is the tazer CMD to take it out

Код:
 PlayerHasTazer[playerid] = 1;

				GivePlayerAdminGun(playerid, 23);
				SetPlayerArmedWeapon(playerid,23);
				format(string, sizeof(string), "* %s unholsters his pistol tazer.", PlayerRPName(playerid));
				ProxDetector(30.0, playerid, string,              COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
How can I make the tazer have 1 bullet & recharges each shot without disappearing and reloads one shot again with /reload anim & shoots

This GivePlayerAdminGun params sucks, it gives u full silencer magazine, 17 bullets


Re: Tazer 1 bullet ! HELP - Rohan_Ubhare - 14.05.2016

To do that, you'll need to use GivePlayerWeapon function to assign him 2 bullet, after that use the SetPlayerArmedWeapon.
After that under OnPlayerKeyStateChange -> KEY_FIRE you'll need to check if the player has tazer and he's shot once using if function and GetPlayerWeaponData. Then when check if the bullet is 1, this would confirm that the player shot once, after that Apply Reload anim to it. And then again set the Ammo to 2. It's not that hard.
PM me if you need more help on this. I'll explain you more about it.