09.11.2010, 15:11
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
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;
}