04.03.2009, 03:43
-1567.9929,-2729.8674,48.7435,278.3784
how would i write:
if playercoords is those coords, give 5 free score points.
how would i write:
if playercoords is those coords, give 5 free score points.
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; }