Kilead Samp
Bem Vindo a : Kilead Samp
Poste seus projetos,aqui!
e Seja Feliz!

Participe do fórum, é rápido e fácil

Kilead Samp
Bem Vindo a : Kilead Samp
Poste seus projetos,aqui!
e Seja Feliz!
Kilead Samp
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Você não está conectado. Conecte-se ou registre-se

[FS] Kick por Votaçao

Ir para baixo  Mensagem [Página 1 de 1]

1[FS] Kick por Votaçao Empty [FS] Kick por Votaçao Ter maio 28, 2013 12:16 am

Leo_Gangster

Leo_Gangster
Admin

Bom essa FileScript é boa para os players que jogam de madrugada quando não tem admin on no server, ela funciona basicamente assim , o player usa o comando para iniciar a votação , encerra a votação e se tiver mais votos positivos do que negativos o player será kikado.

Comandos:
/indicarkick - Inicia e indica o player
/terminarvotacao - Termina a votação
/cancelarin - cancela a votação
sim - vota sim
nao - vota nao


Código:

 #include        a_samp
#include        zcmd
#include        sscanf

#define          Manual        false
#define          Automatico    true

#define          Tempo        ( 2000 * 60 )

new    PlayersOn ,
            JaVotou [ MAX_PLAYERS ] ,
                    _IDKick ,
                        Votacao_aberta = 0,
                                  _Sim,
                                        _Nao ,
                                              _VotacaoTipo@ = Manual ,
                                                                      LigadoAutomatic_ = 0;

public OnPlayerConnect(playerid)
{
    PlayersOn ++ ;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    PlayersOn -- ;
    return 1;
}

command(indicarkick , playerid , params[] )
{
    new _Id ,
              _string [ 150 ],
                              _Motivo [ 100 ];
    if ( PlayersOn < 5 ) return SendClientMessage ( playerid , -1 , "Menos de 5 players não pode ser iniciado a votacao" ) ;
    if ( !Votacao_aberta ) return SendClientMessage ( playerid , -1 , "Votação já esta aberta " ) ;
    if ( sscanf ( params , "us" , _Id , _Motivo ) ) return SendClientMessage ( playerid , -1 , "°CMD° /indicarkick [ ID ] [ Motivo ]" ) ;
    format ( _string , sizeof ( _string ) , "Indicarão o %s para ser kickado [ /sim /nao ] Motivo : %s", PlayerNome (playerid ), _Motivo ) ;
    SendClientMessageToAll ( -1 , _string ) ;
    _IDKick = _Id ;
    if ( _VotacaoTipo@ == Automatico )
    {
          LigadoAutomatic_ = 1 ;
          SetTimer("Contagem", Tempo, true);
    }
    return 1;
}

command(terminarvotacao , playerid , params[] )
{
    new _string [ 75 ] ;
    if ( Votacao_aberta == 1 ) return SendClientMessage ( playerid , -1 , "A Votação não foi iniciado " ) ;
    if ( LigadoAutomatic_ == 1 ) return SendClientMessage ( playerid , -1 , "A Votação esta automatica " ) ;
    SendClientMessageToAll ( -1 , "A Votação foi encerrado" ) ;
    if ( _Sim > _Nao )
    {
        format ( _string ,sizeof ( _string ) , " O Player %s foi kickado . [ Pela Votação ] " , PlayerNome ( _IDKick ) ) ;
        SendClientMessageToAll ( -1 , _string ) ;
        Kick ( _IDKick ) ;
    }
    if ( _Nao > _Sim )
    {
        SendClientMessageToAll ( -1 , " Ninguem foi kickado pela votacao" ) ;
    }
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        JaVotou [ i ] = 0 ;
    }
    _IDKick = -1 ;
    _Nao = 0 ;
    _Sim = 0 ;
    Votacao_aberta = 0 ;
    return 1 ;
}

command(cancelarin , playerid , params [] )
{
    if ( !Votacao_aberta ) return SendClientMessage ( playerid , -1 , "A Votação não foi iniciado " ) ;
    if ( LigadoAutomatic_ == 1 ) return SendClientMessage ( playerid , -1 , "A Votação esta automatica " ) ;
    _IDKick = -1 ;
    _Nao = 0 ;
    _Sim = 0 ;
    Votacao_aberta = 0 ;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        JaVotou [ i ] = 0 ;
    }
    SendClientMessageToAll ( -1 , "Votação cancelada " ) ;
    return 1 ;
}

command(sim , playerid , params[] )
{
    if ( !Votacao_aberta ) return SendClientMessage ( playerid , -1 , "A Votação não foi iniciado " ) ;
    if ( JaVotou [ playerid ] == 1 ) return SendClientMessage (playerid , -1 , "você ja voto" ) ;
    _Sim ++ ;
    JaVotou [ playerid ] = 1 ;
    SendClientMessage ( playerid , -1 , "Seu voto foi computado" ) ;
    return 1 ;
}

command(nao , playerid , params[] )
{
    if ( !Votacao_aberta ) return SendClientMessage ( playerid , -1 , "A Votação não foi iniciado " ) ;
    if ( JaVotou [ playerid ] == 1 ) return SendClientMessage (playerid , -1 , "você ja voto" ) ;
    _Nao ++ ;
    JaVotou [ playerid ] = 1 ;
    SendClientMessage ( playerid , -1 , "Seu voto foi computado" ) ;
    return 1 ;
}

stock PlayerNome ( playerid )
{
    new nome [ MAX_PLAYER_NAME ] ;
    GetPlayerName ( playerid , nome , sizeof ( nome ) );
    return nome ;
}
forward Contagem();
public Contagem()
{
    new _string [ 100 ] ;
    if ( _Sim > _Nao )
    {
        format ( _string ,sizeof ( _string ) , " O Player %s foi kickado . [ Pela Votação ] " , PlayerNome ( _IDKick ) ) ;
        SendClientMessageToAll ( -1 , _string ) ;
        Kick ( _IDKick ) ;
    }
    if ( _Nao > _Sim )
    {
        SendClientMessageToAll ( -1 , " Ninguem foi kickado pela votacao" ) ;
    }
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        JaVotou [ i ] = 0 ;
    }
    _IDKick = -1 ;
    _Nao = 0 ;
    _Sim = 0 ;
    Votacao_aberta = 0 ;
    return 1 ;
}

Aviso: Essa FS tem total responsabilidade de quem a usa, pois alguns players mau intencionado podem ficar criando votação para kikar todos os players. Mais ai vai de sua preferencia, se quiser tambem pode por apenas para que os admins, Helpers, Lideres, Sub-Lideres , usem esses comandos.

OBS: Se encontrar bugs , por favor entre em contato.

Obrigado.

https://kilead-samp.forumeiros.com

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos