All pastes #365812 Raw Edit

Unnamed

public text v1 · immutable
#365812 ·published 2007-02-21 07:04 UTC
rendered paste body
public OnGameModeInit(){
	SetTimer("AreaTimer",7000,true);
}

new interior[MAX_PLAYERS];
new zone[MAX_PLAYERS];

public AreaTimer(){
	for(new i=0;i<MAX_PLAYERS;i++){
		if(IsPlayerConnected(i)){
			new Float:x,Float:y,Float:z;
			GetPlayerPos(i,x,y,z);
			new bool:good;
			for(new a=0;a<sizeof(zones);a++){
				if(a != interior[i]){
					if(x > zones[a][zone_minx] && x < zones[a][zone_maxx] && y > zones[a][zone_miny] && y < zones[a][zone_maxy] && z > zones[a][zone_minz] && z < zones[a][zone_maxz]){
						new str[256];
						format(str,sizeof(str),"~y~%s",zones[a][zone_name]);
						GameTextForPlayer(i,str,3000,1);
						good = true;
						zone[i] = a;
						break;
					}
				}
			}
			if(!good){
				for(new a=0;a<sizeof(intval);a++){
					if(a != interior[i]){
						if(x > intval[a][minx] && x < intval[a][maxx] && y > intval[a][miny] && y < intval[a][maxy] && z > intval[a][minz] && z < intval[a][maxz]){
							new str[256];
							format(str,sizeof(str),"~y~%s",intval[a][intname]);
							GameTextForPlayer(i,str,3000,1);
							interior[i] = a;
							break;
						}
					}
				}
			}
		}
	}
}