[Ajuda] 3 Avisos = Cadeia
#1

Oi, eu queria ajuda nesse comando, quando desse 3 avisos em alguem, a pessoa n ser kickada, queria que ela fosse presa por 10 minutos, e quando relogasse o aviso continuasse, pq qd a pessoa ta relogando, ta saindo os kick '-'

PHP код:
    if( strcmp( cmd, "/avisar", true ) == 0 )
    {
        if( 
aInfo[ playerid ][ Admin ] == 1 || aInfo[ playerid ][ Moderador ] == 1 || aInfo[ playerid ][ Ajudante ] == 1 )
        {
            
tmp = strtok( cmdtext, idx );
            if( !
strlen( tmp ))
            {
                
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /avisar [ ID ] [ aviso ]" );
                return 
1;
            }
            new 
id = strval( tmp );
            
MSG = strrest( cmdtext, idx );
            if( !
strlen( MSG ))
            {
                
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /avisar [ ID ] [ aviso ]" );
                return 
1;
             }
            if( !
IsPlayerConnected( id ))
            {
                
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Ninguйm online com esse ID !" );
                return 
1;
            }
            ++ 
aviso[ id ];
            if( 
aviso[ id ] >= 3 )
            {
                
GameTextForPlayer( id, "~y~~h~Kickado(a)~w~~h~!", 15000, 5 );
                
format( string, sizeof( string ), "[ > ] Vocк foi kickado do servidor ( Motivo: %s ) ( %d/3 )", MSG, aviso[ id ] );
                
SendClientMessage( id, COLOR_ERRO, string );
                return 
Kick( id );
            }
            if( 
aInfo[ playerid ][ Moderador ] == 1 )
            {
                
format( string, sizeof( string ), "* O(A) Moderador(a) %s deu um aviso para %s ( Motivo: %s ) ( %d/3 )", PlayerName( playerid ), PlayerName( id ), MSG, aviso[ id ] );
                
SendClientMessageToAll( 0xCCFF00AA, string );
                
format( string, sizeof( string ), "( AVISO ) Vocк foi avisado %d/3, 3/3 vocк serб kickado !", aviso[ id ] );
                
SendClientMessage( id, COLOR_BRANCO, string );
            }
            if( 
aInfo[ playerid ][ Admin ] == 1 )
            {
                
format( string, sizeof( string ), "* O(A) Administrador(a) %s deu um aviso para %s ( Motivo: %s ) ( %d/3 )", PlayerName( playerid ), PlayerName( id ), MSG, aviso[ id ] );
                
SendClientMessageToAll( 0xCCFF00AA, string );
                
format( string, sizeof( string ), "( AVISO ) Vocк foi avisado %d/3, 3/3 vocк serб kickado !", aviso[ id ] );
                
SendClientMessage( id, COLOR_BRANCO, string );
            }
        }
        else
        {
            
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo tem permissгo!" );
        }
        return 
1;
    } 
Reply
#2

pawn Код:
if( aviso[ id ] >= 3 )
            {
                GameTextForPlayer( id, "~y~~h~Kickado(a)~w~~h~!", 15000, 5 );
                format( string, sizeof( string ), "[ > ] Vocк foi kickado do servidor ( Motivo: %s ) ( %d/3 )", MSG, aviso[ id ] );
                SendClientMessage( id, COLOR_ERRO, string );
                return Kick( id );
Use sua vбriavel de prender trocando pelo kick.
Reply
#3

Eu ja toquei o Kick ali pelo de prender, mais ai a pessoa foi presa e solta na mesmo hora '-' E quando ela relogava saia os avisos que adm tinha dado '-'
Reply
#4

gravou os avisos no arquivo do player?
Reply
#5

Pois entгo, gravou, mais nгo gravou '-'
Reply
#6

podes postar os codes para gravar e para mandar para a jail?
Reply
#7

Ai mano:

PHP код:
    if( !strcmp( cmd, "/aprender", true ))
    {
        if( 
aInfo[ playerid ][ Admin ] == 1 || aInfo[ playerid ][ Moderador ] == 1 )
        {
            
tmp = strtok( cmdtext, idx );
              if( !
strlen( tmp ))
               {
                
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /aPrender [ ID ] [ Tempo ] [ Motivo ]" );
                return 
1;
               }
               new
                   
id = strval( tmp )
               ;
            
tmp = strtok( cmdtext, idx );
              if( !
strlen( tmp ))
               {
                
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /aPrender [ ID ] [ Tempo ] [ Motivo ]" );
                return 
1;
               }
               new
                   
iTempo = strval( tmp )
               ;
               if( 
iTempo < 1 || iTempo > 1200 )
               {
                
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Tempo somente de 1 а 1200 minutos !" );
                return 
1;
               }
            new 
length = strlen( cmdtext );
            while (( 
idx < length ) && ( cmdtext[ idx ] <= ' ' ))
            {
                
idx++;
            }
            new 
offset = idx;
            new 
result[ 64 ];
            while (( 
idx < length ) && (( idx - offset ) < ( sizeof( result ) - 1 )) )
            {
                
result[ idx - offset ] = cmdtext[ idx ];
                
idx++;
            }
            
result[ idx - offset ] = EOS;
              if( !
strlen( result ))
            {
                
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /aPrender [ ID ] [ Tempo ] [ Motivo ]" );
                  return 
1;
            }
               if( !
IsPlayerConnected( id ))
             {
                 
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Ninguйm online com esse ID !" );
                  return 
1;
              }
             if( 
pInfo[ id ][ Preso ] == 1 )
            {
                
MensagemFormatada( playerid, COLOR_SISTEMA, "[ x ] O jogador %s jб estб preso !", PlayerName( id ));
                return 
1;
             }
              
GameTextForPlayer( id, "~w~~h~SE FUDEU!", 3000, 0 );
             
MensagemFormatada( id, 0x3366FFAA, "( PA ) Vocк foi preso pelo(A) Administrador(a) %s ( Motivo: %s, Tempo: %d Minutos )", PlayerName( playerid ), result, iTempo );
            
MensagemFormatada( playerid, 0x33CCFFAA, "( PA ) Vocк prendeu o(a) jogador(a) %s ( Motivo: %s, Tempo: %d Minutos )", PlayerName( id ), result, iTempo );
             
MensagemFormatadaAll( COLOR_AMARELOCLARO, "( PA ) O(A) Administrador(a) %s prendeu %s ( Motivo: %s, Tempo: %d Minutos )", PlayerName( playerid ), PlayerName( id ), result, iTempo );
            
format( gFile, sizeof( gFile ), "Contas/%s.ini", PlayerName( id ));
            
dini_IntSet( gFile, "Abuser", 1 );
            
Algemado[ id ] = 0;
             
SetPlayerWantedLevel( id, 0 );
            
pInfo[ id ][ Preso ] = iTempo*60;
            
ResetPlayerWeapons( id );
            
SetPlayerInterior( id, 6 );
            
SetPlayerPos( id, 264.5996, 77.7367, 1001.0391 );
            
KillTimer( T_Preso[ id ] );
            
T_Preso[ id ] = SetTimerEx( "LiberarPrisao", 1000, false, "d", id );
            
pInfo[ playerid ][ Abuser ] = 1;
        }
        else
        {
            
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo tem permissгo!" );
        }
        return 
1;
    } 
Reply
#8

Voce podia mandar o code para gravar os dados dos players

Acho que devia ser true. Manda tambem a funзгo liberarprisao
pawn Код:
T_Preso[ id ] = SetTimerEx( "LiberarPrisao", 1000, true, "d", id );
Reply
#9

Ai mano:
PHP код:
    if( !strcmp( cmd, "/asoltar", true ))
    {
        if( 
aInfo[ playerid ][ Admin ] == 1 || aInfo[ playerid ][ Moderador ] == 1 )
        {
            
tmp = strtok( cmdtext, idx );
            if( !
strlen( tmp ))
            {
                
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Uso correto: /aSoltar [ ID ]" ) ;
                return 
1;
              }
               new
                 
id = strval( tmp )
            ;
              if( !
IsPlayerConnected( id ))
              {
                 
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Ninguйm online com esse ID !" );
                   return 
1;
              }
             if( 
pInfo[ id ][ Preso ] == 0 )
            {
                
MensagemFormatada( playerid, COLOR_SISTEMA, "[ x ] O jogador %s nгo estб preso !", PlayerName( id ));
                return 
1;
            }
               
GameTextForPlayer( id, "~w~A VAZA!", 3000, 0 );
             
MensagemFormatada( id, 0x3366FFAA, "[ INFO ] O(A) Administrador(a) %s soltou vocк. Nгo cometa mais nenhum abuser ou serб preso por mais tempo !", PlayerName( playerid ));
              
MensagemFormatada( playerid, 0x33CCFFAA, "[ INFO ] Vocк soltou da prisгo o(a) jogador(a) %s", PlayerName( id ));
            
pInfo[ id ][ Preso ] = 0;
            
pInfo[ id ][ Abuser ] = 0;
        }
        else
        {
            
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo tem permissгo!" );
        }
        return 
1;
    } 
O de salvar й sу criar uma "file" com nome de "Aviso" , tipo assim: ( creio eu )
PHP код:
                new
                     
Avisos = dini_Int( f( playerid ), "Avisos" )
                 ;
                 if( 
Avisos >= 3 ) 
Reply
#10

UP !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)