All pastes #336209 Raw Edit

Smugller

public cpp v1 · immutable
·published 2007-02-01 21:46 UTC
rendered paste body
public post_winners(winnerid){new i;	//paralize all	for(i = 0; i < MAX_PLAYERS ; i++)	    if(IsPlayerConnected(i) && !IsPlayerAdmin(i))	        TogglePlayerControllable(i,0);		new string[256];	new winners[3];  //3 first players' ids	winners[0] = winnerid; //pierwsze miejsce	winners[1] = 255;      //drugie miejsce	winners[2] = 255;      //trzecie miejsce	//printf("1. %d 2. %d 3. %d", winners[0], winners[1], winners[2]);	new winames[3][MAX_PLAYER_NAME]; //names of the winnersnew x = -100;for(i = 0; i < MAX_PLAYERS ; i++){	    if (IsPlayerConnected(i) && GetPlayerScore(i) > x && i)	    {	        x = GetPlayerScore(i);	        winners[0] = i;		   }}if(winners[0] !=winnerid)	GetPlayerName(winners[0], winames[0], MAX_PLAYER_NAME);else winames[0] = "---"; x = -100;	for(i = 0; i < MAX_PLAYERS ; i++) //finding 2nd place.	{	    if (IsPlayerConnected(i) && GetPlayerScore(i) > x && i != winners[0])	    {	        x = GetPlayerScore(i);	        winners[1] = i;		}	}	if(winners[1] != 255) GetPlayerName(winners[1], winames[1], MAX_PLAYER_NAME); //if found 2nd place, get his name	else winames[1] = "---";                                      //if not, just write ---	x = -100;	for(i = 0; i < MAX_PLAYERS ; i++) //finding 3rd place.	{	    if (IsPlayerConnected(i) && GetPlayerScore(i) > x && i != winners[0] && i != winners[1])	    {	        x = GetPlayerScore(i);	        winners[2] = i;		}	}	if(winners[2] != 255) GetPlayerName(winners[2], winames[2], MAX_PLAYER_NAME); //if found 3rd place, get his name	else winames[2] = "---";                                      //if not, just write ---	format(string, sizeof(string),"~w~1. ~b~%s   ~y~(%d)~n~~w~2. ~b~%s   ~y~(%d)~n~~w~3. ~b~%s   ~y~(%d)~n~", winames[0], GetPlayerScore(winners[0]), winames[1], GetPlayerScore(winners[1]), winames[2],GetPlayerScore(winners[2]));    GameTextForAll(string,16000,3);    SetTimer("GameModeExitFunc", 15000, 0);}