15.01.2015, 14:18
I'm trying to create a simple timer that checks to see if the player is within range, and if so, burns them. However the timer isn't working. After debugging, I found out the issue is with the IsPlayerInRangeOfPoint line, but can't figure how to fix it.
Or could the issue be the double loop? I was simply trying to save space.
Or could the issue be the double loop? I was simply trying to save space.
pawn Код:
public FireBurn()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
for(new j=0; j<MAX_FIRES; j++)
{
if(IsValidDynamicObject(fire[j]))
{
new Float:x, Float:y, Float:z;
GetDynamicObjectPos(fire[j], x, y, z);
if(IsPlayerInRangeOfPoint(i, 1, x, y, z))
{
new Float:health;
GetPlayerHealth(i, health);
SetPlayerHealth(i, (health - 5));
SendClientMessage(i, -1, "burning...");
}
}
else continue;
}
}
else continue;
}
return 1;
}