All pastes #348142 Raw Edit

cont. why not work :

public text v1 · immutable
·published 2007-02-09 23:22 UTC
rendered paste body
RoundStart() {
	SendClientMessageToAll(COLOR_YELLOW,"DEBUG: round start called");
        new Float:ctx=gMapSpawns[Map][0];
   	new Float:cty=gMapSpawns[Map][1];
   	new Float:ctz=gMapSpawns[Map][2];
   	new Float:tx=gMapSpawns[Map][3];
   	new Float:ty=gMapSpawns[Map][4];
   	new Float:tz=gMapSpawns[Map][5];
        SendClientMessageToAll(COLOR_YELLOW,"DEBUG: before check teams");
	CheckTeams();
	SendClientMessageToAll(COLOR_YELLOW,"DEBUG: after check teams");
	Round++;
	for(new i=0; i<MAX_PLAYERS;i++) {
	    SendClientMessageToAll(COLOR_YELLOW,"DEBUG: start loop");
	    if (IsPlayerConnected(i)) {
	        SetPlayerInterior(i,0);
	        SendClientMessageToAll(COLOR_YELLOW,"DEBUG: before team and wait");
	        if (GetPlayerTeam(i)==CT && Wait[i]==1) {
				TogglePlayerControllable(i,1);
	        	SetPlayerPos(i,ctx,cty,ctz);
	        	SetPlayerInterior(i,0);
	        	if (Round==1) {
	        	    GivePlayerMoney(i,START_MONEY);
     	    	}
     	    	if (Round!=1) {
     	    	    if (GetPlayerTeam(i)==LastTeamWin) {
     	    	        GivePlayerMoney(i,SPAWN_MONEY_WIN);
 	    	        }
 	    	        if (GetPlayerTeam(i)!=LastTeamWin) {
     	    	        GivePlayerMoney(i,SPAWN_MONEY_LOSE);
 	    	        }
     	    	}
     	    	SendClientMessageToAll(COLOR_YELLOW,"DEBUG: after money");
	        	Wait[i]=0;
			}
            if (GetPlayerTeam(i)==T && Wait[i]==1) {
                TogglePlayerControllable(i,1);
                SetPlayerPos(i,tx,ty,tz);
                SetPlayerInterior(i,0);
                if (Round==1) {
	        	    GivePlayerMoney(i,START_MONEY);
     	    	}
     	    	if (Round!=1) {
	        	    if (GetPlayerTeam(i)==LastTeamWin) {
     	    	        GivePlayerMoney(i,SPAWN_MONEY_WIN);
 	    	        }
 	    	        if (GetPlayerTeam(i)!=LastTeamWin) {
     	    	        GivePlayerMoney(i,SPAWN_MONEY_LOSE);
 	    	        }
     	    	}
                Wait[i]=0;
            }
   		}
	}
	RoundTime=ROUND_TIME;
	GameTextForAll("~w~The ~b~Round ~r~Has ~g~Begun ~n~ ~b~ ~h~ Hosted by  [Game-Pride]",3000,3);
}
CheckTeams() {
	new change;
	change=0;
	if ((CTS-TS)>1) {
	    for(new i=100;i>0;i--) {
	        if (IsPlayerConnected(i)) {
	            if ((CTS-TS)>1) {
	                if (RoundStarted==0) {
	                    TS++;
	                    CTS--;
	                    change++;
						SetSpawnInfo(i,2,223, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
					}
				}
			}
		}
	}
	if ((TS-CTS)>1) {
	    for(new i=100;i>0;i--) {
	        if (IsPlayerConnected(i)) {
	            if ((TS-CTS)>1) {
	                if (RoundStarted==0) {
	                    CTS++;
	                    TS--;
	                    change++;
						SetSpawnInfo(i,1, 285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
					}
				}
			}
		}
	}
	if (change>0) {
	    new txt[256];
	    format(txt,sizeof(txt),"There have been %d changes to the teams",change);
	    SendClientMessageToAll(COLOR_WHITE,txt);
	}
}

new Float:gMapSpawns[1][6] = {
(2025.6593,1334.4053,10.6506,2099.9067,2169.8906,10.8203)