Actions inside a Gang-Zones
#1

Hello community,

I have a problem with my gang zones.
I would like to create a godzone, but i dont know how it is defined.
I can create gang zones...
How can I define what happens in there gang zone...

Can you help me there?

Sorry for my bad English knowledge...
Reply
#2

IsPlayerInArea

pawn Код:
public IsPlayerInArea(playerid, Float:data[4])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) {
return 1;
}
return 0;
}
Reply
#3

thnx carlos

data 4 is the SetPlayerHealth line right?
Reply
#4

No it's not, and would that function even work?
Cuz you need to set both minx, miny, maxx and maxy...

pawn Код:
public IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3])
        return 1;
    return 0;
}
Use a timer to check if a player is inside that area
Reply
#5

Hm...But how can I make that the player have godmode
Reply
#6

yeah liek this

pawn Код:
public GodArea(playerid)
{
    if(IsPlayerInArea(playerid, 1109.398, 116.7788, 1331.278, 303.6248))//change cords to ur own
    {
    SetPlayerHealth(playerid, 99999);
    }
    return 1;
}
pawn Код:
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;
}
pawn Код:
SetTimer("GodArea",2000,0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)