Why can't I do this?
#2

pawn Код:
new Float:BotZones[][4] =
{
    {-1654.446289,-161.187805,-1334.446289,-561.187805}
};

stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if (x > minx && x < maxx && y > miny && y < maxy) return 1;
    else return 0;
}

timer OnPlayerEnterBotZone[10000](playerid)
{
    for(new z = 0; z < BotZones; z++) // line 394
    {
        if(IsPlayerInArea(playerid, BotZones[z][0], BotZones[z][1], BotZones[z][2], BotZones[z][3]))
        {
            if(!GetPVarType(playerid, "InBotZone"))
            {
                SetPVarInt(playerid, "InBotZone", 1);
                // TextDrawSetString(SFAirportWarnTD[playerid], "~w~Please note that there are ~r~bots ~w~driving around this area.~n~~n~Leave the ~r~bots ~w~alone, or you will be ~r~admin-jailed~w~!");
            }
        }
    }
}

timer OnPlayerExitBotZone[10000](playerid)
{
    for(new z = 0; z < BotZones; z++) // line 409
    {
        if(!IsPlayerInArea(playerid, BotZones[z][0], BotZones[z][1], BotZones[z][2], BotZones[z][3]))
        {
            if(GetPVarType(playerid, "InBotZone"))
            {
                DeletePVar(playerid, "InBotZone");
                //TextDrawShowForPlayer(playerid, SFAirportWarnTD[playerid]);
            }
        }
    }
}
Try that?
Reply


Messages In This Thread
Why can't I do this? - by Scenario - 17.01.2012, 22:21
Re: Why can't I do this? - by Snowman12 - 17.01.2012, 22:24
Re: Why can't I do this? - by Scenario - 17.01.2012, 22:27
Re: Why can't I do this? - by jamesbond007 - 17.01.2012, 22:53
Re: Why can't I do this? - by Scenario - 17.01.2012, 23:07

Forum Jump:


Users browsing this thread: 1 Guest(s)