12.04.2015, 05:51
My method will work for all objects you created and having position stored in the array. I missed a check just add this:
Rather than OnPlayerUpdate, use a timer or make use of a custom callback based on player position updating(best way).
pawn Код:
public OnPlayerUpdate(playerid)
{
for(new i; i < MAX_OBJECTS; i++)
{
if(IsValidObject(i) && Objects[i][ox] != 0.0 && Objects[i][oy] != 0.0 && Objects[i][oz] != 0.0)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, Objects[i][ox], Objects[i][oy], Objects[i][oz]))
{
SendClientMessage(playerid, -1, "your msg");
}
}
}
return 1;
}