16.04.2014, 11:36
ok im making a something using IsPlayerInRangeOfPoint
but how can add if player leave the rangeofpoint he will spawn or die??
but how can add if player leave the rangeofpoint he will spawn or die??
if(!IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
{
SetPlayerHealth(playerid, 0.0);
}
public OnPlayerUpdate(playerid)
{
If(!IsPlayerInRangeOfPoint(playerid, 15.0, 0.0, 0.0, 0.0))
{
setPlayerHealth(playerid,0.0);
}
}
new RobT[MaxPlayers];
CMD:Rob(playerid,params[])
{
//the rob command ....
RobT[playerid] = SetTimerEx("RobCheck", 500, true, "i", playerid);
}
forward RobCheck(playerid);
public RobCheck(playerid)
{
if(IsRobbing)
{
if(!isinrangeof.....)
{
setPlayerHealth(playerid,0.0);
KillTimer(RobT[playerid]);
}
}
}