SA-MP Forums Archive
Infinite Ammo On a Server - 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: Infinite Ammo On a Server (/showthread.php?tid=497747)



Infinite Ammo On a Server - DoomHunter - 28.02.2014

Hello guys,I have the Raven's Roleplay script,and I want to make every weapon you receive to have Infinite ammo! Because in my opinion it sucks having non infinite weapon ammo!Because people may want to shoot for no reason at place where they can't hurt people


Re: Infinite Ammo On a Server - Avi Raj - 28.02.2014

pawn Код:
GivePlayerWeapon(playerid, weaponid, 10000);



Re: Infinite Ammo On a Server - PrivatioBoni - 28.02.2014

pawn Код:
GivePlayerWeapon(playerid, weaponid, 0x7FFFFFFF);
That will be infinite. 10000 (as seen above) will probably be 10000.


Re: Infinite Ammo On a Server - DoomHunter - 28.02.2014

Where should I put that? I'm a beginner so don't laugh


Re: Infinite Ammo On a Server - PrivatioBoni - 28.02.2014

Quote:
Originally Posted by DoomHunter
Посмотреть сообщение
Where should I put that? I'm a beginner so don't laugh
It's up to you. When do you want them to have the weapon?

e.g. if you want them to have it when they spawn, put it under "OnPlayerSpawn".


Re: Infinite Ammo On a Server - DoomHunter - 28.02.2014

No when they receive the weapon like : you do /sellgun u know or when you go to the lspd locker and on Raven's Roleplay is /duty but on others it is /lspd and then when I do /equip you have like a position to choose and then I want infinite ammo when you receive a weapon like : spas,desert eagle...


Re: Infinite Ammo On a Server - PrivatioBoni - 28.02.2014

Quote:
Originally Posted by DoomHunter
Посмотреть сообщение
No when they receive the weapon like : you do /sellgun u know or when you go to the lspd locker and on Raven's Roleplay is /duty but on others it is /lspd and then when I do /equip you have like a position to choose and then I want infinite ammo when you receive a weapon like : spas,desert eagle...
Just put the line of code underneath the CMD:duty or whatever, if you're still stuck, post the duty command here and I'll add in the line. You could then see how it would fit into other places of your code.

NOTE: For /sellgun and stuff, you wouldn't use "playerid" for the GivePlayerWeapon but whatever symbol you defined the other person as (e.g. "ID").


Re: Infinite Ammo On a Server - DoomHunter - 28.02.2014

Would you mind if I give you the whole folder zipped?


Re: Infinite Ammo On a Server - Miado_Hulk - 28.02.2014

Do a search in the Pawn software for all the: "GivePlayerWeapon"
And replace their number of ammo with: "0x7FFFFFFF'"

Good luck.


Re: Infinite Ammo On a Server - DoomHunter - 28.02.2014

Quote:
Originally Posted by Miado_Hulk
Посмотреть сообщение
Do a search in the Pawn software for all the: "GivePlayerWeapon"
And replace their number of ammo with: "0x7FFFFFFF'"

Good luck.
forward SafeGivePlayerWeapon(playerid, weaponid, ammo); this is all I can find...