09.07.2011, 03:17
Hi. For some reason, i have failed with a loop through players.
This following code stops at ID:0 and won't continue to search for other players.
The idea is, that it should search for any players, who are in the same virtual world and in range of house location X,Y,Z.
I will be very grateful if anyone can find the mistake i've made.
This following code stops at ID:0 and won't continue to search for other players.
The idea is, that it should search for any players, who are in the same virtual world and in range of house location X,Y,Z.
Код:
for(new i = 0; i<APPROX_PLAYERS; i++) { if( (GetPlayerVirtualWorld(i) == houselocW) && (IsPlayerInRangeOfPoint(i, 20, houselocX, houselocY, houselocZ)) ) { SendClientMessage(i, COLOR_YELLOW, "( I ) Riiing.. riing."); SendClientMessage(playerid, COLOR_YELLOW, "( I ) Biip.. biip."); return 1; }else{ SendClientMessage(playerid, COLOR_YELLOW, "( I ) No answer"); return 1; } }