02.05.2012, 09:08
Forward:
Public:
pawn Код:
forward update_zones();
pawn Код:
public update_zones() {
new line1[10];
new line2[10];
for(new i=0; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && zoneupdates[i] == 1) {
if(IsPlayerInZone(i,player_zone[i])) { }
else {
new player_zone_before;
player_zone_before = player_zone[i];
player_zone[i] = -1;
for(new j=0; j<sizeof(zones);j++) {
if(IsPlayerInZone(i,j) && player_zone[i] == -1) {
if(player_zone_before == -1) GameTextForPlayer(i,zones[j][zone_name],1500,1);
else if(strcmp(zones[j][zone_name],zones[player_zone_before][zone_name],true) != 0) GameTextForPlayer(i,zones[j][zone_name],1500,1);
player_zone[i] = j;
format(line1,10,"p%dzone",i);
format(line2,10,"%d",j);
}
}
if(player_zone[i] == -1) player_zone[i] = player_zone_before;
}
}
}
}