Me ajuda a configurar o comando /setaradmin ? -
MarlboroBr - 14.02.2015
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( !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 [ Patrao/Admin/Moderador/Ajudante ] [ 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;
}
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;
}
return 1;
}
Re: Me ajuda a configurar o comando /setaradmin ? -
ThuuGLif3 - 14.02.2015
Код:
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;
}
Re: Me ajuda a configurar o comando /setaradmin ? -
MarlboroBr - 14.02.2015
Mano, era sу adicionar isso em no final de cada ''aInfo'' que faz salvar lб no INI ?
Exemplo:
PHP код:
dini_IntSet( f( id ), "Adminstrador", 1 );
PHP код:
aInfo[ id ][ administrador ] = 1;
PHP код:
dini_IntSet( f( id ), "Adminstrador", 0 );
PHP код:
aInfo[ id ][ administrador ] = 0;
Re: Me ajuda a configurar o comando /setaradmin ? -
ThuuGLif3 - 14.02.2015
Sim!
Re: Me ajuda a configurar o comando /setaradmin ? -
MarlboroBr - 14.02.2015
Pow, sucesso brother, valeu aew! Eu estava com 3 problemas, vocк resolveu 2. Obrigadгo !
Re: Me ajuda a configurar o comando /setaradmin ? -
ThuuGLif3 - 14.02.2015
O que precisar,
Skype: gustavo.chagas2012
Abraзo! Boa sorte com o server, Sу inove.
Re: Me ajuda a configurar o comando /setaradmin ? -
MarlboroBr - 14.02.2015
Valeu!!!