Me ajuda a configurar o comando /setaradmin ?
#1

Pessoal, eu estou com um problema que й o seguinte, eu seto admin, o cara reloga e o admin sai, eu quero configurar para o meu "/setaradmin" aplicar lб no INI do player, alguem me ajuda?!

PHP код:
    if( !strcmpcmd"/staff"true ))
    {
        if( 
dini_Intfplayerid ), "Patrao" ) == )
        {
            return 
0;
        }
        
tmp strtokcmdtextidx );
          if( !
strlentmp ))
          {
              
SendClientMessageplayeridCOLOR_ERRO"[ x ] Uso correto: /Staff [ Patrao/Admin/Moderador/Ajudante ] [ ID ]" );
            return 
1;
        }
                else if( !
strcmptmp"Admin"true ))
        {
            
tmp strtokcmdtextidx );
            if( !
strlentmp ))
            {
                
SendClientMessageplayeridCOLOR_ERRO"[ x ] Uso correto: /Staff [ Admin ] [ ID ]" );
                return 
1;
            }
            new
                
id strvaltmp )
            ;
            if( !
IsPlayerConnectedid ))
            {
                
SendClientMessageplayeridCOLOR_ERRO"[ x ] Ninguйm online com esse ID !" );
                return 
1;
            }
            if( 
aInfoid ][ Administrador ] == )
            {
                
formatgstringsizeofgstring ), "[ > ] Vocк tornou um gerente o jogador '%s'."PlayerNameid ));
                
SendClientMessageplayerid0x66FF00AAgstring );
                   
formatgstringsizeofgstring ), "( PARABЙNS ) Vocк recebeu privilegios de gerente por '%s'."PlayerNameplayerid ));
                
SendClientMessageid0x66FF00AAgstring );
                
aInfoid ][ administrador ] = 1;
            }
            else if( 
aInfoid ][ Administrador ] == )
            {
                 
formatgstringsizeofgstring ), "[ > ] Vocк removeu os privilйgios de administrador de '%s'."PlayerNameid ));
                
SendClientMessageplayerid0x66FF00AAgstring );
                   
formatgstringsizeofgstring ), "[ INFO ] '%s' removeu os privilйgios de administrador de vocк."PlayerNameplayerid ));
                
SendClientMessageid0x66FF00AAgstring );
                
aInfoid ][ Administrador ] = 0;
            }
            return 
1;
        } 
Reply
#2

Код:
    if( !strcmp( cmd, "/staff", true ))
    {
        if( dini_Int( f( playerid ), "Patrao" ) == 0 )
        {
            return 0;
        }
        tmp = strtok( cmdtext, idx );
          if( !strlen( tmp ))
          {
              SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /Staff [ Admin ] [ ID ]" );
            return 1;
        }
                else if( !strcmp( tmp, "Admin", true ))
        {
            tmp = strtok( cmdtext, idx );
            if( !strlen( tmp ))
            {
                SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /Staff [ Admin ] [ ID ]" );
                return 1;
            }
            new
                id = strval( tmp )
            ;
            if( !IsPlayerConnected( id ))
            {
                SendClientMessage( playerid, COLOR_ERRO, "[ x ] Ninguйm online com esse ID !" );
                return 1;
            }
            if( aInfo[ id ][ Administrador ] == 0 )
            {
                format( gstring, sizeof( gstring ), "[ > ] Vocк tornou um gerente o jogador '%s'.", PlayerName( id ));
                SendClientMessage( playerid, 0x66FF00AA, gstring );
                format( gstring, sizeof( gstring ), "( PARABЙNS ) Vocк recebeu privilegios de gerente por '%s'.", PlayerName( playerid ));
                SendClientMessage( id, 0x66FF00AA, gstring );
                aInfo[ id ][ administrador ] = 1;
                dini_IntSet( f( id ), "Adminstrador", 1 );
            }
            else if( aInfo[ id ][ Administrador ] == 1 )
            {
                format( gstring, sizeof( gstring ), "[ > ] Vocк removeu os privilйgios de administrador de '%s'.", PlayerName( id ));
                SendClientMessage( playerid, 0x66FF00AA, gstring );
                format( gstring, sizeof( gstring ), "[ INFO ] '%s' removeu os privilйgios de administrador de vocк.", PlayerName( playerid ));
                SendClientMessage( id, 0x66FF00AA, gstring );
                aInfo[ id ][ Administrador ] = 0;
                dini_IntSet( f( id ), "Adminstrador", 0 );
            }
            return 1;
        }
Reply
#3

Mano, era sу adicionar isso em no final de cada ''aInfo'' que faz salvar lб no INI ?

Exemplo:

PHP код:
                dini_IntSetfid ), "Adminstrador"); 
PHP код:
aInfoid ][ administrador ] = 1
PHP код:
                dini_IntSetfid ), "Adminstrador"); 
PHP код:
aInfoid ][ administrador ] = 0
Reply
#4

Sim!
Reply
#5

Pow, sucesso brother, valeu aew! Eu estava com 3 problemas, vocк resolveu 2. Obrigadгo !
Reply
#6

O que precisar, Skype: gustavo.chagas2012
Abraзo! Boa sorte com o server, Sу inove.
Reply
#7

Valeu!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)