Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ======================================= //
- // # Includes # //
- // ======================================= //
- #include A_SaMP «
- #include DoF2 «
- #include zCmD «
- #include SSCanF2 «
- #define xCor_AzulBB 0x33CCFFAA //
- #define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0) // By Paulor
- #define Ban(%0) SetTimerEx("Bana", 100, false, "i", %0) // By Paulor
- forward Bana(p); public Bana(p) {
- #undef Ban
- Ban(p);
- #define Ban(%0) SetTimerEx("Bana", 100, false, "i", %0)
- return 1;
- }
- forward Kicka(p); public Kicka(p) {
- #undef Kick
- Kick(p);
- #define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
- return 1;
- }
- new
- Segundo, Minuto, Hora, Dia, Mes, Ano ;
- stock xNome ( playerid )
- {
- new nOME [ 21 ] ;
- GetPlayerName ( playerid, nOME, 21 ) ;
- return nOME;
- }
- public OnFilterScriptInit ()
- {
- print ("# ============================= #") ;
- print ("# Sistema de Bans By Smirnoff #");
- print ("# ============================= #");
- return 1;
- }
- public OnFilterScriptExit ()
- {
- DOF2_Exit () ;
- return 1;
- }
- public OnPlayerRequestClass ( playerid, classid )
- {
- new
- xCelulas [ 180 ], xPastaxX [ 64 ], xPasta2 [ 64 ], xPasta3 [ 64 ], xIP [ 16 ] ;
- format ( xPasta3, 60, "AgendadosBan/%s.ini", xNome ( playerid ) ) ;
- if ( DOF2_FileExists ( xPasta3 ) )
- {
- format ( xCelulas, 180, " Banido\n\n\nStatus: Banido\n\nAdmin %s\n\nMotivo: %s\n\nConta: %s\n\n\nFoi injusto? tire SS e poste revisão no fórum\n\nseuforum.com.br", DOF2_GetString ( xPasta3, "Admin" ), DOF2_GetString ( xPasta3, "Motivo" ), xNome ( playerid ) ) ;
- ShowPlayerDialog ( playerid, 5555, DIALOG_STYLE_MSGBOX, "BANIDO", xCelulas, "Fechar","" ) ;
- Kicka ( playerid ) ;
- }
- format ( xPastaxX, 60, "Banidos/%s.ini", xNome ( playerid ) ) ;
- if ( DOF2_FileExists ( xPastaxX ) )
- {
- format ( xCelulas, 180, " Banido\n\n\nStatus: Banido\n\nAdmin %s\n\nMotivo: %s\n\nConta: %s\n\n\nFoi injusto? tire SS e poste revisão no fórum\n\nseuforum.com.br", DOF2_GetString ( xPastaxX, "Admin" ), DOF2_GetString ( xPastaxX, "Motivo" ), xNome ( playerid ) ) ;
- ShowPlayerDialog ( playerid, 5556, DIALOG_STYLE_MSGBOX, "BANIDO", xCelulas, "Fechar","" ) ;
- Kicka ( playerid ) ;
- }
- GetPlayerIp ( playerid, xIP, 16 ) ;
- format ( xPasta2, 60, "IPsBanidos/%s.ini", xIP ) ;
- if ( DOF2_FileExists ( xPasta2 ) )
- {
- format ( xCelulas, 180, " Banido\n\n\nStatus: Banido\n\nAdmin %s\n\nMotivo: %s\n\nConta: %s\n\nIP: %s\n\n\nFoi injusto? tire SS e poste revisão no fórum\n\nseuforum.com.br", DOF2_GetString ( xPasta2, "Admin" ), DOF2_GetString ( xPasta2, "Motivo" ), xNome ( playerid ), DOF2_GetString ( xPasta2, "IP" ) ) ;
- ShowPlayerDialog ( playerid, 5557, DIALOG_STYLE_MSGBOX, "BANIDO", xCelulas, "Fechar","" ) ;
- Kicka ( playerid ) ;
- }
- return 1;
- }
- COMMAND:banir ( playerid, params [] )
- {
- new
- xID, xMotivo [ 50 ], xCelulas [ 190 ], Negro [ 21 ], xPastaa [ 64 ], xPastaS [ 64 ], xDats [ 14 ], xHoraa [ 22 ], xIP [ 16 ] ;
- if ( !IsPlayerConnected ( playerid ) )
- return SendClientMessage ( playerid, -1, "[ ERRO ]: Você não está logado" ) ;
- if ( sscanf ( params, "us[50]", xID, xMotivo ) )
- return SendClientMessage ( playerid, -1, "[ USE ]: /banir [ID] [Motivo]" ) ;
- if ( !IsPlayerConnected ( playerid ) )
- return SendClientMessage ( playerid, -1, "[ ERRO ]: ID não conectado" ) ;
- GetPlayerName ( xID, Negro, 21 ) ;
- getdate ( Ano, Mes, Dia ) ;
- gettime ( Hora, Minuto, Segundo ) ;
- format ( xDats, 14, "%d/%d/%d", Dia, Mes, Ano ) ;
- format ( xHoraa, 22, "%d:%d:%d", Hora, Minuto, Segundo ) ;
- format ( xCelulas, 128, "[ BanSystem ]: %s foi banido do servidor pelo administrador %s, Motivo: %s", Negro, xNome ( playerid ), xMotivo ) ;
- SendClientMessageToAll ( xCor_AzulBB, xCelulas ) ;
- format ( xCelulas, 190, " Banido\n\n\nStatus: Banido\n\nAdmin %s\n\nMotivo: %s\n\nConta: %s\n\n\nTire SS e poste revisão no fórum\n\nseuforum.com.br", xNome ( playerid ), xMotivo, Negro ) ;
- ShowPlayerDialog ( xID, 55, DIALOG_STYLE_MSGBOX, "Banido do Servidor", xCelulas, "Sair", "" ) ;
- Kicka ( xID ) ;
- GetPlayerIp ( xID, xIP, 16 ) ;
- format ( xPastaa, 40, "Banidos/%s.ini", Negro ) ;
- if ( DOF2_CreateFile ( xPastaa ) )
- {
- DOF2_SetString ( xPastaa, "Admin", xNome ( playerid ) ) ;
- DOF2_SetString ( xPastaa, "Motivo", xMotivo ) ;
- DOF2_SetString ( xPastaa, "Data", xDats ) ;
- DOF2_SetString ( xPastaa, "Hora", xHoraa ) ;
- DOF2_SaveFile ( ) ;
- }
- format ( xPastaS, 40, "IPsBanidos/%s.ini", xIP );
- if ( DOF2_CreateFile ( xPastaS ) )
- {
- DOF2_SetString ( xPastaS, "Admin", xNome ( playerid ) ) ;
- DOF2_SetString ( xPastaS, "Motivo", xMotivo ) ;
- DOF2_SetString ( xPastaS, "Data", xDats ) ;
- DOF2_SetString ( xPastaS, "Hora", xHoraa ) ;
- DOF2_SetString ( xPastaS, "IP", xIP ) ;
- DOF2_SaveFile () ;
- }
- return 1 ;
- }
- COMMAND:agendarban ( playerid, params[] )
- {
- new
- LekNome [ 20+1 ], LekBan [ 20+1 ], LekMotivo [ 25 ], LekArquivo [ 64 ], LekCelulas [ 128 ], LekData [ 14 ], LekHora [ 22 ] ;
- if ( sscanf ( params, "s[21]s[25]", LekNome, LekMotivo ) )
- return SendClientMessage ( playerid, xCor_AzulBB, "[ USE ]: /agendarban [Nick_Sobrenick] [Motivo]" ) ;
- format ( LekArquivo, 64, "Contas/%s.ini", LekNome ) ;
- if ( !DOF2_FileExists ( LekArquivo ) )
- return SendClientMessage ( playerid, xCor_AzulBB, "[ ERRO ]: Está conta não existe no banco de dados" ) ;
- format ( LekCelulas, 128, "[ BanSystem ]: Admin %s agendou ban no nick %s. Motivo: %s", xNome ( playerid ), LekNome, LekMotivo ) ;
- SendClientMessageToAll ( xCor_AzulBB, LekCelulas ) ;
- getdate ( Ano, Mes, Dia ) ;
- gettime ( Hora, Minuto, Segundo ) ;
- format ( LekData, 14, "%d/%d/%d", Dia, Mes, Ano ) ;
- format ( LekHora, 22, "%d:%d:%d", Hora, Minuto, Segundo ) ;
- format ( LekBan, 64, "AgendadosBan/%s.ini", LekNome ) ;
- if ( DOF2_CreateFile ( LekBan ) )
- {
- DOF2_SetString ( LekBan, "Admin", xNome ( playerid ) ) ;
- DOF2_SetString ( LekBan, "Motivo", LekMotivo ) ;
- DOF2_SetString ( LekBan, "Data", LekData ) ;
- DOF2_SetString ( LekBan, "Hora", LekHora ) ;
- DOF2_SaveFile () ;
- }
- return 1 ;
- }
- COMMAND:retirarbana ( playerid, params[] )
- {
- new
- xCelulas [ 128 ], xPastaX [ 64 ], xNomesX [ 21 ] ;
- if ( sscanf ( params, "s[21]", xNomesX ) )
- return SendClientMessage ( playerid, xCor_AzulBB, "[ USE ]: /retirarbana [Nick]");
- format ( xPastaX, 64, "AgendadosBan/%s.ini", xNomesX ) ;
- if ( fexist( xPastaX ) )
- {
- DOF2_RemoveFile ( xPastaX ) ;
- SendClientMessage ( playerid, xCor_AzulBB, "[ AVISO ]: Conta agendada desbanida com sucesso");
- format ( xCelulas, 128, "[ BanSystem ]: Admin %s retirou o agendamento de ban do nick %s", xNome ( playerid ), xNomesX ) ;
- SendClientMessage ( playerid, xCor_AzulBB, xCelulas ) ;
- }
- else return SendClientMessage ( playerid, xCor_AzulBB, "[ ERRO ]: Este nick não está agendado" ) ;
- return 1 ;
- }
- COMMAND:desbanirconta ( playerid, params[] )
- {
- new
- xCelulas [ 128 ], xPastaX [ 64 ], xNomesX [ 21 ] ;
- if ( sscanf ( params, "s[21]", xNomesX ) )
- return SendClientMessage ( playerid, xCor_AzulBB, "[ USE ]: /desbanconta [Nick]");
- format ( xPastaX, 64, "Banidos/%s.ini", xNomesX ) ;
- if ( fexist( xPastaX ) )
- {
- DOF2_RemoveFile ( xPastaX ) ;
- SendClientMessage ( playerid, xCor_AzulBB, "[ AVISO ]: Conta desbanida com sucesso");
- format ( xCelulas, 128, "[ BanSystem ]: Admin %s desbaniu a conta %s", xNome ( playerid ), xNomesX ) ;
- SendClientMessage ( playerid, xCor_AzulBB, xCelulas ) ;
- }
- else return SendClientMessage ( playerid, xCor_AzulBB, "[ ERRO ]: Este nick não está banido" ) ;
- return 1;
- }
- COMMAND:desbanirip ( playerid, params[] )
- {
- static
- xCelulas [ 128 ], xPastaXx [ 64 ], xIP [ 16 ] ;
- if ( sscanf ( params, "s[16]", xIP ) )
- return SendClientMessage ( playerid, xCor_AzulBB, "[ USE ]: /desbanconta [IP]");
- format ( xPastaXx, 64, "IPsBanidos/%s.ini", xIP ) ;
- if ( fexist( xPastaXx ) )
- {
- DOF2_RemoveFile ( xPastaXx ) ;
- SendClientMessage ( playerid, -1, "[ AVISO ]: Conta desbanida com sucesso");
- format ( xCelulas, 128, "[ BanSystem ]: Admin %s desbaniu o IP %s", xNome ( playerid ), xIP ) ;
- SendClientMessage ( playerid, xCor_AzulBB, xCelulas ) ;
- }
- else return SendClientMessage ( playerid, xCor_AzulBB, "[ ERRO ]: Este IP não está banido" ) ;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement