Coordinates
#10

I know the problem.
I had: "stock IsPlayerInArea(playerid, minx, miny);" etc..
But it had to be: Float:minx, Float:minxy etc...
ps, I am making a "better" script (same way, just different)
Please wait...

[EDIT]
DONE!
Try this script

pawn Код:
#include <a_samp>

new pTimer_Check[MAX_PLAYERS];
new pSecondsInArea[MAX_PLAYERS];

forward CheckPInArea(playerid);

public OnFilterScriptInit()
{
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    pTimer_Check[playerid] = SetTimerEx("CheckPInArea", 1000, true, "i", playerid);
    pSecondsInArea[playerid] = 0;
    return 1;
}

public OnPlayerDeath(playerid)
{
    KillTimer(pTimer_Check[playerid]);
    pSecondsInArea[playerid] = 0;
    return 1;
}

public CheckPInArea(playerid)
{
    if(IsPlayerInArea(playerid, 892.6697, 2049.596, 978.5764, 2188.846)){
        pSecondsInArea[playerid]++;
        if(pSecondsInArea[playerid] >= 15)
            SetPlayerHealth(playerid, 0);
    }
    else if(!IsPlayerInArea(playerid, 892.6697, 2049.596, 978.5764, 2188.846)){
        pSecondsInArea[playerid] = 0;
    }
    return 1;
}

stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    if(pX >= MinX && pX <= MaxX && pY <= MinY && pY >= MaxY)
        return true;
    else
        return false;
 }
Reply


Messages In This Thread
Coordinates - by Larsey123IsMe - 09.11.2010, 12:59
Re: Coordinates - by Cameltoe - 09.11.2010, 13:06
Re: Coordinates - by Larsey123IsMe - 09.11.2010, 13:17
Re: Coordinates - by Larsey123IsMe - 09.11.2010, 14:12
Re: Coordinates - by Larsey123IsMe - 09.11.2010, 14:45
Re: Coordinates - by Kwarde - 09.11.2010, 14:51
Re: Coordinates - by Larsey123IsMe - 09.11.2010, 14:56
Re: Coordinates - by Kwarde - 09.11.2010, 14:59
Re: Coordinates - by Larsey123IsMe - 09.11.2010, 15:02
Re: Coordinates - by Kwarde - 09.11.2010, 15:11

Forum Jump:


Users browsing this thread: 1 Guest(s)