[Ajuda] /lideres
#1

alguйm pode dar uma ajudinha neste cуdigo que fiz:
pawn Код:
if(strcmp(cmd, "/lideres", true) == 0)
    {
        for(new l = 0; l < dini_Get(gFile, "Dono"); l++)
        {
            if(IsPlayerConnected(l))
            {
                new msg[64];
                SendClientMessage(playerid, -1, "[BDP] Lнderes Online:");
                format(msg, sizeof(msg), "[BDP] Lнder %s | Clг %s", dini_Get(gFile, "Dono"), dini_Get(pFile, "cla"));
                SendClientMessage(playerid, -1, msg);
            }
            else return SendClientMessage(playerid, -1, "[BDP] Nenhum lнder online");
        }
        return 1;
    }
Reply
#2

oque tem de errado?
Reply
#3

pawn Код:
error 033: array must be indexed (variable "dini_Get")
pawn Код:
if(strcmp(cmd, "/lideres", true) == 0)
    {
        for(new l = 0; l < dini_Get(gFile, "Dono"); l++) // <<< aqui
        {
            if(IsPlayerConnected(l))
            {
                new msg[64];
                SendClientMessage(playerid, -1, "[BDP] Lнderes Online:");
                format(msg, sizeof(msg), "[BDP] Lнder %s | Clг %s", dini_Get(gFile, "Dono"), dini_Get(pFile, "cla"));
                SendClientMessage(playerid, -1, msg);
            }
            else return SendClientMessage(playerid, -1, "[BDP] Nenhum lнder online");
        }
        return 1;
    }
Reply
#4

pawn Код:
if( strcmp( cmd, "/lideres", true ) == 0 )
    {
        new
            countliders
        ;
        SendClientMessage( playerid, -1, "[BDP] Lнderes Online:" );
       
        for( new l = 0; l < MAX_PLAYERS; l++ ) // <<< aqui
        {
            if( IsPlayerConnected( l ))
            {
                new
                    msg[ 64 ]
                ;
                format( pFile, sizeof( pFile ), "clas/%s.ini", PlayerName( i ));
               
                if( dini_Exists( pFile ))
                {
                    if( strcmp( dini_Get( pFile, "cla" ), "Nenhum", false ))
                    {
                        new
                            formy[ 128 ]
                        ;
                        format( formy, sizeof( formy ), "clas/%s.ini", dini_Get( pFile, "cla" ));
                       
                        if( strcmp( dini_Get( formy, "Dono" ), PlayerName( i ), true ) == 0 )
                        {
                            countliders ++;
                            format( msg, sizeof( msg ), "[BDP] Lнder %s | Clг %s", PlayerName( i ), dini_Get( pFile, "cla" ));
                            SendClientMessage( playerid, -1, msg );
                        }
                    }
                }
            }
        }
        if( countliders <= 0 ) return SendClientMessage( playerid, -1, "[BDP] Nenhum lнder online");
        return 1;
    }
   
stock PlayerName( playerid )
{
    new gName[MAX_PLAYER_NAME+1];
    GetPlayerName( playerid, gName, sizeof(gName));
    return gName;
}
Reply
#5

gFile nгo deveria ser o resultado de um format?
Reply
#6

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
gFile nгo deveria ser o resultado de um format?
Sim, pelo que eu vejo ele usa meu sistema de gangue, entгo acho que jб tem definido '-'
Reply
#7

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size: 664 bytes
Code size: 49736 bytes
Data size: 42192 bytes
Stack/heap size: 16384 bytes; estimated max. usage=5347 cells (21388 bytes)
Total requirements: 108976 bytes
Reply
#8

Quote:
Originally Posted by Cristhian
Посмотреть сообщение
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size: 664 bytes
Code size: 49736 bytes
Data size: 42192 bytes
Stack/heap size: 16384 bytes; estimated max. usage=5347 cells (21388 bytes)
Total requirements: 108976 bytes
Uso de muitas cйlulas tenta diminuir algumas strings.
Reply
#9

Quote:
Originally Posted by [NWD]Jim._.Carrey
Посмотреть сообщение
Uso de muitas cйlulas tenta diminuir algumas strings.
nгo me diga '-'
Reply
#10

Quote:
Originally Posted by Cristhian
Посмотреть сообщение
nгo me diga '-'
lol sу achei que nгo sabia e quis ajudar, tenso.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)