All pastes #611421 Raw Edit

ClanBattle Team Kill Fix

public text v1 · immutable
·published 2007-07-09 22:20 UTC
rendered paste body
	if(IsPlayerConnected(killerid))
	{
	if(gTeam[killerid] == TEAM_1)
	{
		if (gTeam[playerid] == gTeam[killerid])
		sCount1--;
		else
		sCount1++;
		format(string2, sizeof(string2), "%s Score: %d", TEAM1, sCount1);
		SendClientMessageToAll(COLOR_YELLOW, string2);

		for(new z=0;z<MAX_PLAYERS;z++){
		if(gTeam[z] == 0){
        format(gtstring, sizeof(gtstring), "~n~~n~~n~~n~~n~~n~~n~~n~~b~%s:~r~%d ~w~   ~b~%s:~r~%d", TEAM1, sCount1, TEAM2, sCount2);
		GameTextForPlayer(z,gtstring,3500,3);
		}
	    }
	    }

	if(gTeam[killerid] == TEAM_2)
	{
		if (gTeam[playerid] == gTeam[killerid])
		sCount2--;
		else
		sCount2++;
		format(string3, sizeof(string3), "%s Score: %d", TEAM2, sCount2);
		SendClientMessageToAll(COLOR_YELLOW, string3);
		
		for(new y=0;y<MAX_PLAYERS;y++){
		if(gTeam[y] == 1){
        format(gtstring, sizeof(gtstring), "~n~~n~~n~~n~~n~~n~~n~~n~~b~%s:~r~%d ~w~   ~b~%s:~r~%d", TEAM1, sCount1, TEAM2, sCount2);
		GameTextForPlayer(y,gtstring,3500,3);
		}
	    }
	    }
    	}

	if(sCount1 == MAXKILLS)
	{
	    format(string, sizeof(string), "%s has WON the CLAN WAR!", TEAM1);
	    strins(winner,TEAM1,0,sizeof(winner));
	    iStats();
		sStats();
	    SendClientMessageToAll(COLOR_YELLOW, string);
	}
	else if(sCount2 == MAXKILLS)
	{
	    format(string, sizeof(string), "%s has WON the CLAN WAR!", TEAM2);
	    strins(winner,TEAM2,0,sizeof(winner));
	    iStats();
		sStats();
	    SendClientMessageToAll(COLOR_YELLOW, string);
	}