GangZone
#1

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

pawn Код:
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?

pawn Код:
InfoZone[i][gMin_x]
InfoZone[i][gMin_y]
InfoZone[i][gMax_x]
InfoZone[i][gMax_y]
Reply
#2

PHP код:
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.

Reply
#3

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

PHP код:
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
        
}

Reply
#4

Quote:
Originally Posted by FailerZ
Посмотреть сообщение
PHP код:
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н.
Reply
#5

Quote:
Originally Posted by frouzen
Посмотреть сообщение
PHP код:
IsPlayerInArea(playeridFloat:minxFloat:maxxFloat:minyFloat:maxy)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    if (
minx && maxx && miny && maxy) return 1;
    return 
0;

PHP код:
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)