SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/11/2017, 07:22 PM   #1
Mamoru
Big Clucker
 
Join Date: Mar 2015
Location: Argentina
Posts: 89
Reputation: 4
Default GangZone

Hi, how can I detect if I am inside a GangZone?
How to detect if I am within these coordinates?

Code:
InfoZone[i][gMin_x]
InfoZone[i][gMin_y]
InfoZone[i][gMax_x]
InfoZone[i][gMax_y]



•••••••••••••••••••••••••••••••••••



Hola, como puedo hacer para detectar si estoy dentro de un GangZone?
-Como detectar si estoy dentro de estαs coordenadas?

Code:
InfoZone[i][gMin_x]
InfoZone[i][gMin_y]
InfoZone[i][gMax_x]
InfoZone[i][gMax_y]
Mamoru is offline   Reply With Quote
Old 23/11/2017, 07:34 PM   #2
FailerZ
Huge Clucker
 
FailerZ's Avatar
 
Join Date: Oct 2013
Location: 33.5138° N, 36.2765° E
Posts: 228
Reputation: 26
Default Re: GangZone

PHP Code:
new Float:xFloat:yFloat:z;
GetPlayerPos(playeridxyz);

if(
InfoZone[i][gMin_x] && InfoZone[i][gMax_x] && InfoZone[i][gMin_y] && InfoZone[i][gMax_y])
{
    
//Player id is inside the zone. Do something.
}
else
{
    
//Player id is outside the zone. You could skip the whole else part.

__________________
My old work:
[FilterScript]Digital Health & Armour [DHA]
[FilterScript]Labels Creator [LC]
[FilterScript]Debug Mode [D-Mode]
[FilterScript]Advance Fish System [AFS]
FailerZ is offline   Reply With Quote
Old 23/11/2017, 07:35 PM   #3
frouzen
Little Clucker
 
frouzen's Avatar
 
Join Date: Mar 2014
Location: Macedonia
Posts: 22
Reputation: 4
Default Re: GangZone

PHP Code:
IsPlayerInArea(playeridFloat:minxFloat:maxxFloat:minyFloat:maxy)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    if (
minx && maxx && miny && maxy) return 1;
    return 
0;

PHP Code:
for(new ii<(the variable for your max gang zones); i++)
{
        if(
IsPlayerInArea(playeridInfoZone[i][gMin_x], InfoZone[i][gMax_x], InfoZone[i][gMin_y], InfoZone[i][gMax_y]))
        {
                
// do this
        
}

frouzen is offline   Reply With Quote
Old 23/11/2017, 07:49 PM   #4
Mamoru
Big Clucker
 
Join Date: Mar 2015
Location: Argentina
Posts: 89
Reputation: 4
Smile Re: GangZone

Quote:
Originally Posted by FailerZ View Post
PHP Code:
new Float:xFloat:yFloat:z;
GetPlayerPos(playeridxyz);

if(
InfoZone[i][gMin_x] && InfoZone[i][gMax_x] && InfoZone[i][gMin_y] && InfoZone[i][gMax_y])
{
    
//Player id is inside the zone. Do something.
}
else
{
    
//Player id is outside the zone. You could skip the whole else part.




Thank you!!

I did not know how to do something like that.

••••••••••••

Gracias, no sabνa como hacer algo asν.
Mamoru is offline   Reply With Quote
Old 23/11/2017, 07:52 PM   #5
Mamoru
Big Clucker
 
Join Date: Mar 2015
Location: Argentina
Posts: 89
Reputation: 4
Thumbs up Re: GangZone

Quote:
Originally Posted by frouzen View Post
PHP Code:
IsPlayerInArea(playeridFloat:minxFloat:maxxFloat:minyFloat:maxy)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    if (
minx && maxx && miny && maxy) return 1;
    return 
0;

PHP Code:
for(new ii<(the variable for your max gang zones); i++)
{
        if(
IsPlayerInArea(playeridInfoZone[i][gMin_x], InfoZone[i][gMax_x], InfoZone[i][gMin_y], InfoZone[i][gMax_y]))
        {
                
// do this
        
}


Thanks, it also helped me
Mamoru is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gangzone help oppo1234 Scripting Help 2 05/06/2015 07:20 PM
[Ajuda] GANGZONE lekinho911 Portuguκs/Portuguese 2 02/09/2013 01:14 AM
gangzone help ThaCrypte Scripting Help 2 13/08/2013 03:31 PM
[Ajuda] GangZone davi54723 Portuguκs/Portuguese 4 12/11/2012 03:46 AM
How to make a Gangzone Flash if one of the players of the gangzone spawn Bearfist Help Archive 0 09/04/2009 04:11 PM


All times are GMT. The time now is 02:42 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.