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


Messages In This Thread
Help detecting minX, maxX, minY and maxY not working ! - by admantis - 29.10.2010, 02:38
Re: Help detecting minX, maxX, minY and maxY not working ! - by bigcomfycouch - 29.10.2010, 02:53
Respuesta: Help detecting minX, maxX, minY and maxY not working ! - by admantis - 29.10.2010, 02:55

Forum Jump:


Users browsing this thread: 1 Guest(s)