SA-MP Forums Archive
how 2 different checkareas? - 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: how 2 different checkareas? (/showthread.php?tid=238169)



Help me with this script please! - Gemini - 11.03.2011

How can I add more to this code:

PHP код:
public isPlayerInArea()
   {
       new 
Float:XFloat:YFloat:Z//We use this to store player position
       
for(new i=0MAX_PLAYERSi++) //This line defines a name for all player, the name is "i"
       
{
           
GetPlayerPos(iXYZ); //Here we are storing the player position on the variables X, Y, and Z defined previously
           
if (<= 2918 && >= 925 && >= 598 && <= 2606)
           
/* This line is the important one!. Here, is where you change those numbers, by the ones
           you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
           doesnt matter*/
           
{
               
ResetPlayerWeapons(i);
           }
       }
   } 
because I want to create anoter square area where weapons will be reset if a player enters, for this area the
x = 17 - -218 and y = -174 - -386

so it should be this: if (X <= 17 && X >= -218 && Y >= -174 && Y <= -36

but where do I add the code into this script? Help please.


Re: how 2 different checkareas? - Stigg - 11.03.2011

Use incognitos streamer for your areas, its very versatile.

https://sampforum.blast.hk/showthread.php?tid=102865


Re: how 2 different checkareas? - Gemini - 11.03.2011

But im using MidoStreamer.


Re: how 2 different checkareas? - Stigg - 11.03.2011

Quote:
Originally Posted by Gemini
Посмотреть сообщение
But im using MidoStreamer.
Incognitos does it all, all tricks in 1 box, easy to impliment too.
Its just a suggestion.


Re: how 2 different checkareas? - Gemini - 11.03.2011

anymore solutions besides that streamer you're suggesting?


Re: how 2 different checkareas? - Gemini - 11.03.2011

ANYBODY? bump


Re: how 2 different checkareas? - Gemini - 11.03.2011

well this forum is very helpful, bump


Re: how 2 different checkareas? - Kwarde - 11.03.2011

rofl we all aint got all time.
We also have a life ya? And don't bump that fast. Sometimes, people don't answer my topics (because they're probably too complicated for them XD)
However, I also made something that could be nice for ya.
https://sampforum.blast.hk/showthread.php?tid=229423
Check the topic and their functions and callback. You can check when someone enters an area (OnPlayerEnterArea), or you can just use "IsPlayerInArea" (or if that's already defined, automatic "IsPlayerInAreaEx").
You must use 'CreateArea' first!!!. Just check this script: http://kwarde.pastebin.com/zQzmaZti for its usage.