[Ajuda] Me ajudem por favor
#1

Uma duvida como saber o player mais rico ou de mais score online com um comando?
Reply
#2

pawn Код:
Usa GetPlayerScore Ou GetPlayerMoney
Reply
#3

eu sei sу q n sei "calculala" ... Mas ja tentei e dava bug se alguem saber como q apareceria o mais rico ou d mais score por favor
Reply
#4

hum...
isso й sistema de rank.

pawn Код:
stock TopPlayersOnline()
{
    new string[256];
    while(Percorrido < 10) {
        for(new i; i < 500; i++)  if(IsPlayerConnected(i)) {
            if(GetPlayerScore(i) > Valor_Maximo[Percorrido] && TopFoi[i] == false) {
                GetPlayerName(i,PlayerMelhor[Percorrido],24);
                Valor_Maximo[Percorrido] = GetPlayerScore(i);
                TopFoi[i] = true;
            }
        }
        Percorrido++;
    }
    for(new a; a < 500; a++)  if(IsPlayerConnected(a)) TopFoi[a] = false;
    Percorrido = 0;
    for(new i; i < 10;i++)
    {
        if(PlayerMelhor[i][0] != EOS)
        {
            format(string ,64,"[%d] - Player: %s | Score: %d",i+1,PlayerMelhor[i],Valor_Maximo[i]);
            TextDrawSetString(trank,string);
            TextDrawShowForAll(trank);
            Valor_Maximo[i] = -1;
        }
    }
}
Reply
#5

Quote:
Originally Posted by Bruno Alves
Посмотреть сообщение
eu sei sу q n sei "calculala" ... Mas ja tentei e dava bug se alguem saber como q apareceria o mais rico ou d mais score por favor
Monte um loop como este :


pawn Код:
new Jogador, Dinheiro, Ultimo, Maior;
for(new x = 0, y = GetMaxPlayers(); x != y; x++)
{
    Dinheiro = GetPlayerMoney(x);
    if(Dinheiro > Ultimo)
    {
        Maior = Dinheiro;
        Jogador = x;
    }
    Ultimo = Dinheiro;
}
printf("[O mais rico] ID: %d.  Dinheiro: %d.", Jogador, Maior);


Espero ter ajudado .
Reply
#6

Код:
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1431) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1431) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1431) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1426) : warning 204: symbol is assigned a value that is never used: "Maior"
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1427) : warning 204: symbol is assigned a value that is never used: "Jogador"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
pawn Код:
CMD:testii(playerid){
new Jogador, Dinheiro, Ultimo, Maior;
for(new x = 0, y = GetMaxPlayers(); x != y; x++)
{
    Dinheiro = GetPlayerMoney(x);
    if(Dinheiro > Ultimo)
    {
        Maior = Dinheiro;
        Jogador = x;
    }
    Ultimo = Dinheiro;
}
SendClientMessage(playerid, -1,"O mais rico й %s [id: %d.]  Dinheiro: %d." ,pname, Jogador, Maior);
return 1;
}
Tentei passar para SendClient... e deu warnings me ajudem por favor
Reply
#7

Quote:
Originally Posted by Bruno Alves
Посмотреть сообщение
Код:
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1431) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1431) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1431) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1426) : warning 204: symbol is assigned a value that is never used: "Maior"
C:\Documents and Settings\Bruno Alves\Desktop\[TDM]Brasil Top Killers\gamemodes\BTV.pwn(1427) : warning 204: symbol is assigned a value that is never used: "Jogador"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
pawn Код:
CMD:testii(playerid){
new Jogador, Dinheiro, Ultimo, Maior;
for(new x = 0, y = GetMaxPlayers(); x != y; x++)
{
    Dinheiro = GetPlayerMoney(x);
    if(Dinheiro > Ultimo)
    {
        Maior = Dinheiro;
        Jogador = x;
    }
    Ultimo = Dinheiro;
}
SendClientMessage(playerid, -1,"O mais rico й %s [id: %d.]  Dinheiro: %d." ,pname, Jogador, Maior);
return 1;
}
Tentei passar para SendClient... e deu warnings me ajudem por favor
pawn Код:
CMD:testii(playerid){
new Jogador, Dinheiro, Ultimo, Maior,String[128];
for(new x = 0, y = GetMaxPlayers(); x != y; x++)
{
    Dinheiro = GetPlayerMoney(x);
    if(Dinheiro > Ultimo)
    {
        Maior = Dinheiro;
        Jogador = x;
    }
    Ultimo = Dinheiro;
}
format(String, sizeof(String), "[INFO] O mais rico й %s[ID:%d] - Dinheiro: %d.", pname, Jogador, Maior);
SendClientMessage(playerid, -1, String);
return 1;
}
Reply
#8

vlw rjj , @Riichard e Chefгo, olhem agr add tbm score funcionou mais acho q fico mal identado, se tiver como identar melhor me ajude.
PHP код:
CMD:recorde(playerid){
new 
JogadorDinheiro,teste,teste2UltimoscoreMaior;
for(new 
0GetMaxPlayers(); != yx++)
{
    
Dinheiro GetPlayerMoney(x);
    
score GetPlayerScore(x);
    if(
Dinheiro Ultimo)
    {
        
Maior Dinheiro;
        
Jogador x;
    }
        if(
score teste2)
    {
        
teste score;
        
Jogador x;
    }
    
Ultimo Dinheiro;
    
teste2 score;
}
format(hstringsizeof(hstring), "[INFO] O mais rico й %s[ID:%d] - Dinheiro: %d."pnameJogadorMaior);
SendClientMessage(playerid, -1hstring);
format(hstringsizeof(hstring), "[INFO] O de mais score й %s[ID:%d] - Score: %d."pnameJogadorteste);
SendClientMessage(playerid, -1hstring);
return 
1;

Reply
#9

pawn Код:
CMD:recorde(playerid)
{
    new Jogador, Dinheiro, teste, teste2, Ultimo, score, Maior;
    for (new x = 0, y = GetMaxPlayers(); x != y; x++)
    {
        Dinheiro = GetPlayerMoney(x);
        score = GetPlayerScore(x);
        if (Dinheiro > Ultimo)
        {
            Maior = Dinheiro;
            Jogador = x;
        }
        if (score > teste2)
        {
            teste = score;
            Jogador = x;
        }
        Ultimo = Dinheiro;
        teste2 = score;
    }
    format(hstring, sizeof(hstring), "[INFO] O mais rico й %s[ID:%d] - Dinheiro: %d.", pname, Jogador, Maior);
    SendClientMessage(playerid, -1, hstring);
    format(hstring, sizeof(hstring), "[INFO] O de mais score й %s[ID:%d] - Score: %d.", pname, Jogador, teste);
    SendClientMessage(playerid, -1, hstring);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)