Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

What happend here?!

$
0
0
Hello, I've creating a something for Hightlist kills of map And creating the codes But There is a problem What is it?

I've creating the code and there are no errors/warrings but When someone killed other They are not update the Textdraw To Example: Thanks - 1 Like that But I really dont know Its not Updated them Anyone can help me?

PHP Code:

public OnPlayerSpawn(playerid)
{
      new 
firstsecondthirdfourthfifth;
    new 
Nick[50][MAX_PLAYER_NAME], string[MAX_PLAYER_NAME],string20[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(string20sizeof(string20), "~R~#1 - ~W~%s"Nick[0]);
            
TextDrawSetString(Textdraw12string20);
            
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;


I've creating the Textdraws for them and There are no problem Just They not updated Kills when someone Killed

Viewing all articles
Browse latest Browse all 18226

Trending Articles