04.03.2009, 03:52
well, it's almost imposible to be on exact those coords, so you better use the PlayerToPoint-function.
Код:
SetTimer("CheckPos", 100, 1);
Код:
forward CheckPos(); public CheckPos() { for(new i; i<MAX_PLAYERS; i++) { if(PlayerToPoint(0.1, i, -1567.9929,-2729.8674,48.7435) { SetPlayerScore(i, (GetPlayerScore(i)+5)); } } }
Код:
PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z) { new Float:oldpos[3], Float:temppos[3]; GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]); temppos[0] = (oldpos[0] -X); temppos[1] = (oldpos[1] -Y); temppos[2] = (oldpos[2] -Z); if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius))) { return true; } return false; }