SA-MP Forums Archive
Get back the weapons - 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: Get back the weapons (/showthread.php?tid=606971)



Get back the weapons - SonicFreeStyle - 12.05.2016

Hello! i need some help but i don't have any idea of how start this... i'm making a arena system for my RPG server. i want to make a system that remove the weapons from the player before he enter on arena and give it back when he exits...can you help me?


Re: Get back the weapons - oMa37 - 12.05.2016

Save the player weapons when he join the arena, and when he leave, give him the weapons back.
This may help you
http://pastebin.com/TaD5miwQ


Re: Get back the weapons - Amunra - 12.05.2016

Quote:
Originally Posted by SonicFreeStyle
Посмотреть сообщение
Hello! i need some help but i don't have any idea of how start this... i'm making a arena system for my RPG server. i want to make a system that remove the weapons from the player before he enter on arena and give it back when he exits...can you help me?
Save the Weapon ID With SetPVarInt ... and to Get the Weapon data you can Use "GetPlayerWeaponData" !


Re: Get back the weapons - MBilal - 12.05.2016

Код:
new aOldWeapon[MAX_PLAYERS][13],OldAmmo[MAX_PLAYERS][13];
//this is where you are saving weapon before enter in area .
		  		for(new i; i < 13; ++i)
				{
					GetPlayerWeaponData(playerid, i, aOldWeapon[playerid][i], OldAmmo[playerid][i]);
				}

//this is when you leave arena.
//if u give anyweapon in arena then use ResetPlayerWeapons other wise not needed.
				ResetPlayerWeapons(playerid);
				for(new i; i < 13; ++i)
				{
					GivePlayerWeapon(playerid, aOldWeapon[playerid][i], OldAmmo[playerid][i]);
				}
//this give player his weapons.