SA-MP Forums Archive
[One more question =D] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [One more question =D] (/showthread.php?tid=157791)



[One more question =D] - Kevin_Joshen - 07.07.2010

Ok....... so... i have my players type /dm1..... they are sent to a minigun match...... how do i get it so that when they are leaving a DM zone, they lose that gun?

Also, how do i get it so that when they are in the stunt area, they cannot fire their weapon?

Please don't post something saying "just go read the wiki dumbass!"

please actually post helpful things.
Thank you!


Re: [One more question =D] - [SF]Bamdude37 - 07.07.2010

Quote:

how do i get it so that when they are leaving a DM zone, they lose that gun?

ResetPlayerWeapons(playerid); will work fine for that


Re: [One more question =D] - killer98p - 07.07.2010

Deleted [Check the up post]


Re: [One more question =D] - Miikkel - 07.07.2010

Quote:
Originally Posted by Kevin_Joshen
Посмотреть сообщение
please actually post helpful things.
Thank you!
Helpful things isn't just getting a code. It is to learn how to do it, so you can make it your self.


Re: [One more question =D] - CAR - 07.07.2010

Don't know how to lose 1 gun but you can Reset all weapons:
pawn Код:
ResetPlayerWeapons(playerid);



Re: [One more question =D] - Kevin_Joshen - 07.07.2010

Aight thanks! So just do

ResetPlayerWeapons(playerid);


and where should i put that? and that is all i need to put? is just (what is above) in the section that you tell me? and then their weapons are reset?


@Miikkel I never said i just wanted code.... i just said don't post stupid things like someone randomly posting "Vagina!" ............ believe me... it happens! =D


Re: [One more question =D] - Hiddos - 07.07.2010

Losing 1 gun:

pawn Код:
new weap; ammo;
GetPlayerWeaponData(playerid,7,weap,ammo); // Slot 7 was minigun etc right? The weapon is saved in the weap variable and his ammo is saved in the ammo variable.
GivePlayerWeapon(playerid,weap,-ammo); // Gives the player the negative amount of ammo he currently holds for his 'weap'.



Re: [One more question =D] - CAR - 07.07.2010

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
Losing 1 gun:

pawn Код:
new weap; ammo;
GetPlayerWeaponData(playerid,7,weap,ammo); // Slot 7 was minigun etc right? The weapon is saved in the weap variable and his ammo is saved in the ammo variable.
GivePlayerWeapon(playerid,weap,-ammo); // Gives the player the negative amount of ammo he currently holds for his 'weap'.
This will also define if it's a minigun:

pawn Код:
new weap; ammo;
GetPlayerWeaponData(playerid,7,weap,ammo); // Slot 7 was minigun etc right? The weapon is saved in the weap variable and his ammo is saved in the ammo variable.
if(weap == 38) // is the weapon id of a Minigun
{
   GivePlayerWeapon(playerid,weap,-ammo); // Gives the player the negative amount of ammo he currently holds for his 'weap'.
}



Re: [One more question =D] - Kevin_Joshen - 07.07.2010

Alright! thanks!

But, how do i have it so that their weapons are just un-usable in Stunt areas? and usuable once they are out of the stunt zone?


Re: [One more question =D] - Hiddos - 07.07.2010

pawn Код:
public OnPlayerUpdate(playerid)
{
  if(IsPlayerInStuntArea(playerid)) SetPlayerArmedWeapon(playerid,0);
  return 1;
}
Just noticed this is exactly on the wiki D: