What happend here?!
#6

OnPlayerSpawn

PHP код:
public OnPlayerSpawn(playerid)
{
    new 
Random random(sizeof(RandomSpawns));
    
SetPlayerPos(playeridRandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    
SetPlayerFacingAngle(playeridRandomSpawns[Random][3]);
    
    
SetPlayerColor(playeridCOLOR_RED);
    
    
GivePlayerWeapon(playerid27100);
    
GivePlayerWeapon(playerid24100);
    
GivePlayerWeapon(playerid285000);
    
GivePlayerWeapon(playerid31100);
    
GivePlayerWeapon(playerid34100);
    new 
firstsecondthirdfourthfifth;
    new 
Nick[6][MAX_PLAYER_NAME], string[MAX_PLAYER_NAME];
    for(new 
i=0;i<MAX_PLAYERS;i++) // This loop will check for the player that has the most kills
    
{
        if(
kills[i] > kills[first])
        {
            
first i;
            
GetPlayerName(firstNick[0], MAX_PLAYER_NAME);
            
format(stringsizeof(string), "~R~#1 - ~W~%s"Nick[0]);
            
TextDrawSetString(Textdraw12string);
            
TextDrawShowForPlayer(playeridTextdraw12);
        }
    }
    for(new 
d=0;d<MAX_PLAYERS;d++) // This loop will check for the player that has the second most kills
    
{
        if(
first == d) continue;
        if(
kills[d] > kills[second])
        {
            
GetPlayerName(secondNick[0], MAX_PLAYER_NAME);
            
format(stringsizeof(string), "~R~#2 - ~W~%s"Nick[0]);
            
second d;
            
TextDrawSetString(Textdraw13string);
            
TextDrawShowForPlayer(playeridTextdraw13);
        }
    }
    for(new 
s=0;s<MAX_PLAYERS;s++) // This loop will check for the player that has the third most kills
    
{
        if(
first == || second == s) continue;
        if(
kills[s] > kills[third])
        {
            
GetPlayerName(thirdNick[0], MAX_PLAYER_NAME);
            
format(string[0], sizeof(string), "~R~#3 - ~W~%s"Nick[0]);
            
third s;
            
TextDrawSetString(Textdraw14string);
            
TextDrawShowForPlayer(playeridTextdraw14);
        }
    }
    for(new 
a=0;a<MAX_PLAYERS;a++) // This loop will check for the player that has the fourth most kills
    
{
        if(
first == || second == || third == a) continue;
        if(
kills[a] > kills[fourth])
        {
            
GetPlayerName(fourthNick[0], MAX_PLAYER_NAME);
            
format(stringsizeof(string), "~R~#4 - ~W~%s"Nick[0]);
            
fourth a;
            
TextDrawSetString(Textdraw15string);
            
TextDrawShowForPlayer(playeridTextdraw15);
        }
    }
    for(new 
c=0;c<MAX_PLAYERS;c++) // This loop will check for the player that has the fifth most kills
    
{
        if(
first == || second == || third == || fourth == c) continue;
        if(
kills[c] > kills[fifth])
        {
            
GetPlayerName(fifthNick[0], MAX_PLAYER_NAME);
            
format(stringsizeof(string), "~R~#5 - ~W~%s"Nick[0]);
            
fifth c;
            
TextDrawSetString(Textdraw15string);
            
TextDrawShowForPlayer(playeridTextdraw16);
        }
    }
    return 
1;

Is there wrong?
Reply


Messages In This Thread
What happend here?! - by Thanks - 29.12.2017, 17:16
Re: What happend here?! - by Kaperstone - 29.12.2017, 17:22
Re: What happend here?! - by Thanks - 29.12.2017, 17:25
Re: What happend here?! - by Thanks - 29.12.2017, 17:30
Re: What happend here?! - by RogueDrifter - 29.12.2017, 17:30
Re: What happend here?! - by Thanks - 29.12.2017, 17:34
Re: What happend here?! - by Thanks - 29.12.2017, 19:47
Re: What happend here?! - by Thanks - 30.12.2017, 19:42
Re: What happend here?! - by Thanks - 31.12.2017, 07:48
Re: What happend here?! - by RogueDrifter - 31.12.2017, 08:07

Forum Jump:


Users browsing this thread: 1 Guest(s)