SA-MP Forums Archive
[HELP] Question - 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: [HELP] Question (/showthread.php?tid=126298)



[HELP] Question - jonybomb - 07.02.2010

Hi, how to make an area where it can not be armed? As an example the function AllowInteriorWeapons() but without being in the interior. Being any other area of San Andreas? Like safe zone

Thanks


Re: [HELP] Question - mansonh - 07.02.2010

Here is a simple example.
http://forum.sa-mp.com/index.php?top...4003#msg904003

Or you can use a full area check system, see sig.

Then just disable weapons when players are in the area.


Re: [HELP] Question - jonybomb - 07.02.2010

And how to disable weapons? What is the function?


Re: [HELP] Question - mansonh - 07.02.2010

to disable weapons

SetPlayerArmedWeapon(playerid, 0); will put them to hands

then if they try to change to another weapon
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(/*your area check*/) SetPlayerArmedWeapon(playerid, 0);
}




Re: [HELP] Question - jonybomb - 07.02.2010

stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
return 0;
}

Here, I change the X by my coords?

sorry but i never do scripts like this one


Re: [HELP] Question - mansonh - 07.02.2010

no you would call this function with your coordinates.

IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y); <-- your coordinates here.




Re: [HELP] Question - jonybomb - 07.02.2010

Yeah, thanks brother