Help detecting minX, maxX, minY and maxY not working !
#1

Hello everybody. So the idea of this script was to restringe every other zone so people must stay in the battle field. I created some gang zones to representate them, and it worked but besudes the gangzones, it has no effect.. Look at my script (im a newbie scripter !)

pawn Код:
public OnPlayerConnect(playerid)
{
    SetTimer("CheckZone",700,1);
        // Other shit.
        return 1;
}
pawn Код:
public CheckZone(playerid)
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    if((X < -864.1628) && (X < -4087.256) && (Y > 4063.901) && (Y < 2989.536))
    {
        GameTextForPlayer(playerid, "~R~PROHIBITED ZONE~N~ ~N~ ~N~ ~N~ ~R~ LEAVE OR YOU WILL BE ANIHILATED",10000,6);
        SetTimer("ZoneKill",10000,0);
    }
   
    if ((X < -2977.858) && (X > 2627.522) && (Y < 2837.724) && (Y > 2977.858))
    {
        GameTextForPlayer(playerid,"~R~PROHIBITED ZONE~N~ ~N~ ~N~ ~N~ ~R~ LEAVE OR YOU WILL BE ANIHILATED",10000,6);
        SetTimer("ZoneKill",10000,0);
    }
    if ((X < -2989.536) && (X > -3316.517) && (Y < -2662.556) && (Y > 2989.536))
    {
        GameTextForPlayer(playerid,"~R~PROHIBITED ZONE~N~ ~N~ ~N~ ~N~ ~R~ LEAVE OR YOU WILL BE ANIHILATED",10000,6);
        SetTimer("ZoneKill",10000,0);
    }
    if ((X < -2966.18) && (X > -3012.892) && (Y < 3082.959) && (Y > 58.38938))
    {
        GameTextForPlayer(playerid,"~R~PROHIBITED ZONE~N~ ~N~ ~N~ ~N~ ~R~ LEAVE OR YOU WILL BE ANIHILATED",10000,6);
        SetTimer("ZoneKill",10000,0);
    }
    if ((X < -2989.536) && (X > -3188.06) && (Y < -1996.917) && (Y > 934.23))
    {
        GameTextForPlayer(playerid,"~R~PROHIBITED ZONE~N~ ~N~ ~N~ ~N~ ~R~ LEAVE OR YOU WILL BE ANIHILATED",10000,6);
        SetTimer("ZoneKill",10000,0);
    }
}
The coordenate syntax is minX,maxX,minY,maxY

pawn Код:
public ZoneKill(playerid,vehicleid)
{
    new Float:x, Float:y, Float:z;
    GetVehiclePos(vehicleid, x, y, z);
    CreateExplosion(x+random(5), y+random(5), z+random(5), 12, 10.0);
    CreateExplosion(x+random(3), y+random(3), z+random(3), 2, 10.0);
    new CurrentVeh = GetPlayerVehicleID(playerid);
    SetVehicleHealth(CurrentVeh,200);
    GameTextForPlayer(playerid,"~R~ ~n~ YOU HAVE BEEN WARNED, PREPARE TO BE ANIHILATED",10000,6);
    return 1;
}
It has zero warnings & zero errors when compiling but In Game it really doesnt have any effect..
Please help me to improve this script!
Reply
#2

I just overlooked it a bit, but I think some of your checks were off

http://pastebin.com/TUK0d8mT
Reply
#3

Thanks, but how I should change this line?

pawn Код:
#define IsBetween(%1,%2,%3)         (((%1) > (%2)) && ((%1) < (%3)))
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)