Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sistema Criado por Smokiie_Gamer
- // PS: Fassa Salvamento do Sistema Admin, conforme seu Registro.
- //==========================================================================================//
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #include <DOF2>
- //==========================================================================================//
- #define PASTA_CONTAS "Contas/%s.ini"// Coloque na sua pasta.
- #define DIALOG_LOGAR_ADM 1
- #define DIALOG_BANIDO 2
- //==========================================================================================//
- #define SendClientFormat(%0,%1,%2,%3); format(String, sizeof(String), %2, %3); SendClientMessage(%0, %1, String);
- #define SendClientFormatToAll(%0,%1,%2); format(String, sizeof(String), %1, %2); SendClientMessageToAll(%0, String);
- #define KickEx(%0) SetTimerEx("Kicka", 100, false, "i", %0)
- forward Kicka(p);
- //==========================================================================================//
- enum pInfo
- {
- Admin
- }
- //==========================================================================================//
- new Jogador[MAX_PLAYERS][pInfo];
- new String[100];
- new StringContas[100];
- new StringBanidos[100];
- new Dia, Mes, Ano, Hora, Minuto, Segundo;
- //==========================================================================================//
- #define VERMELHO 0xFF0000FF
- #define GOLD 0xFFD700FF
- //==========================================================================================//
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Sistema Criado por Smokiie_Gamer");
- print("--------------------------------------\n");
- return 1;
- }
- #endif
- public OnFilterScriptExit()
- {
- DOF2_Exit();
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(DOF2_FileExists(StringBanidos))
- {
- SendClientFormatToAll(VERMELHO, "O(A) Administrador(a) Guardiao kickou o(a) jogador(a) %s ( Motivo: Banido )", Nome(playerid));
- new StringCat[1000];
- strcat(StringCat, "{FFFFFF}Você está banido deste servidor!\n\n");
- strcat(StringCat, " Seguem os Dados:\n\n");
- format(String, sizeof(String), "{FF0000}Nick: {FFFFFF}%s\n", Nome(playerid)); strcat(StringCat, String);
- format(String, sizeof(String), "{FF0000}Admin Responsável: {FFFFFF}%s\n", DOF2_GetString(StringBanidos, "Admin")); strcat(StringCat, String);
- format(String, sizeof(String), "{FF0000}Motivo: {FFFFFF}%s\n", DOF2_GetString(StringBanidos, "Motivo")); strcat(StringCat, String);
- format(String, sizeof(String), "{FF0000}Data: {FFFFFF}%d/%d/%d\n", DOF2_GetInt(StringBanidos, "Dia"), DOF2_GetInt(StringBanidos, "Mês"), DOF2_GetInt(StringBanidos, "Ano")); strcat(StringCat, String);
- format(String, sizeof(String), "{FF0000}Hora: {FFFFFF}%d:%d\n\n", DOF2_GetInt(StringBanidos, "Hora"), DOF2_GetInt(StringBanidos, "Minuto")); strcat(StringCat, String);
- strcat(StringCat, "{FFFFFF}Se isto foi um engano acesse a {00FF00}SeuSite.com\n");// Coloque sue site
- strcat(StringCat, "{FFFFFF}e faça sua revisão em banidos seguindo as regras");
- ShowPlayerDialog(playerid, DIALOG_BANIDO, DIALOG_STYLE_MSGBOX, "{FF0000}Banido", StringCat, "Fechar", "");
- KickEx(playerid);
- return 1;
- }
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_LOGAR_ADM)
- {
- if(response)
- {
- format(StringContas, sizeof(StringContas), PASTA_CONTAS, Nome(playerid));
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, DIALOG_LOGAR_ADM, DIALOG_STYLE_PASSWORD, "{00FF00}Logar Adm", "{FFFFFF}Digite sua Senha !\n", "Continuar", "Cancelar");
- SendClientMessage(playerid, VERMELHO, "Digite uma senha!");
- return 1;
- }
- if(strlen(inputtext) < 5)
- {
- ShowPlayerDialog(playerid, DIALOG_LOGAR_ADM, DIALOG_STYLE_PASSWORD, "{00FF00}Logar Adm", "{FFFFFF}Digite sua Senha !\n", "Continuar", "Cancelar");
- SendClientMessage(playerid, VERMELHO, "Digite uma senha!");
- return 1;
- }
- if(strcmp(DOF2_GetString("SenhaAdmin.ini", "SenhaAdmin"), inputtext, true) == 0)// Crie 1 Bloco de notas com o Nome SenhaAdmin e guarde como .ini
- {
- Jogador[playerid][Admin] = DOF2_GetInt(StringContas, "Admin");
- SendClientFormat(playerid, GOLD, "Você logou na administração com sucesso! Logado como nível %d", Jogador[playerid][Admin]);
- return 1;
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGAR_ADM, DIALOG_STYLE_PASSWORD, "{00FF00}Logar Adm", "{FFFFFF}Digite sua Senha !\n", "Continuar", "Cancelar");
- SendClientMessage(playerid, VERMELHO, "Senha incorreta!");
- return 1;
- }
- }
- }
- return 1;
- }
- CMD:setaradmin(playerid, params[])
- {
- new ID;
- new Nivel;
- if(!IsPlayerAdmin(playerid)) return 0;
- if(sscanf(params, "ud", ID, Nivel)) return SendClientMessage(playerid, VERMELHO, "Use: /setaradmin (id) (Nivel)");
- if(Nivel < 0 || Nivel > 4) return SendClientMessage(playerid, VERMELHO, "Nivel invalido! Use de 0 a 4");
- format(StringContas, sizeof(StringContas), PASTA_CONTAS, Nome(ID));
- DOF2_SetInt(StringContas, "Admin", Nivel);
- Jogador[ID][Admin] = 0;
- DOF2_SaveFile();
- if(Nivel == (1))
- {
- SendClientFormat(playerid, GOLD, "Você deu o cargo de Ajudante para o(a) jogador(a) %s[%d].", Nome(ID), ID);
- SendClientFormat(ID, GOLD, "O(A) Staff %s deu o cargo de Ajudante para você.", Nome(playerid), playerid);
- format(String, sizeof(String), "O(A) Staff %s deu o cargo de Ajudante para o %s", Nome(playerid), Nome(ID));
- }
- if(Nivel == (2))
- {
- SendClientFormat(playerid, GOLD, "Você deu o cargo de Moderador(a) para o(a) jogador(a) %s[%d].", Nome(ID), ID);
- SendClientFormat(ID, GOLD, "O(A) Staff %s deu o cargo de Moderador(a) para você.", Nome(playerid), playerid);
- format(String, sizeof(String), "O Staff %s deu o cargo de Moderador para o %s", Nome(playerid), Nome(ID));
- }
- if(Nivel == (3))
- {
- SendClientFormat(playerid, GOLD, "Você deu o cargo de Administrador(a) para o(a) jogador(a) %s[%d].", Nome(ID), ID);
- SendClientFormat(ID, GOLD, "O(A) Staff %s deu o cargo de Administrador(a) para você.", Nome(playerid), playerid);
- format(String, sizeof(String), "O Staff %s deu o cargo de Administrador para o %s", Nome(playerid), Nome(ID));
- }
- if(Nivel == (4))
- {
- SendClientFormat(playerid, GOLD, "Você deu o cargo de Staff para o(a) jogador(a) %s[%d].", Nome(ID), ID);
- SendClientFormat(ID, GOLD, "O(A) Staff %s deu o cargo de Staff para você.", Nome(playerid), playerid);
- format(String, sizeof(String), "O Staff %s deu o cargo de Staff para o %s", Nome(playerid), Nome(ID));
- }
- return 1;
- }
- CMD:logaradm(playerid)
- {
- if(Jogador[playerid][Admin] < 1)
- {
- format(StringContas, sizeof(StringContas), PASTA_CONTAS, Nome(playerid));
- if(DOF2_GetInt(StringContas, "Admin") > 0)
- {
- ShowPlayerDialog(playerid, DIALOG_LOGAR_ADM, DIALOG_STYLE_PASSWORD, "{00FF00}Logar Adm", "{FFFFFF}Digite a senha que está nos tópicos invisíveis\n do fórum:\n", "Continuar", "Cancelar");
- }
- else SendClientMessage(playerid, VERMELHO, "Você não é um administrador!");
- return 1;
- }
- else SendClientMessage(playerid, VERMELHO, "Você já está logado como adm!");
- return 1;
- }
- CMD:ir(playerid, params[])
- {
- new Float: X, Float: Y, Float: Z, ID;
- if(Jogador[playerid][Admin] > 0)
- {
- if(sscanf(params, "d", ID)) return SendClientMessage(playerid, VERMELHO, "Use: /ir (id)");
- if(IsPlayerConnected(ID))
- {
- GetPlayerPos(ID, X, Y, Z);
- SetPlayerInterior(playerid, GetPlayerInterior(ID));
- SetPlayerPos(playerid, X+2, Y+2, Z);
- if(Jogador[playerid][Admin] == 1)
- {
- SendClientFormat(ID, GOLD, "O(A) Ajudante %s foi até à sua posição!", Nome(playerid));
- SendClientFormat(playerid, GOLD, "Você foi até à posição do(a) jogador(a) %s[%i].", Nome(ID), ID);
- format(String, sizeof(String), "O(A) Ajudante %s foi até à posição do jogador %s.", Nome(playerid), Nome(ID));
- }
- if(Jogador[playerid][Admin] == 2)
- {
- SendClientFormat(ID, GOLD, "O(A) Moderador(a) %s foi até à sua posição!", Nome(playerid));
- SendClientFormat(playerid, GOLD, "Você foi até à posição do(a) jogador(a) %s[%i].", Nome(ID), ID);
- format(String, sizeof(String), "O(A) Moderador(a) %s foi até à posição do jogador %s.", Nome(playerid), Nome(ID));
- }
- if(Jogador[playerid][Admin] == 3)
- {
- SendClientFormat(ID, GOLD, "O(A) Administrador(a) %s foi até à sua posição!", Nome(playerid));
- SendClientFormat(playerid, GOLD, "Você foi até à posição do(a) jogador(a) %s[%i].", Nome(ID), ID);
- format(String, sizeof(String), "O(A) Administrador(a) %s foi até à posição do jogador %s.", Nome(playerid), Nome(ID));
- }
- if(Jogador[playerid][Admin] == 4)
- {
- SendClientFormat(ID, GOLD, "O(A) Staff %s foi até à sua posição!", Nome(playerid));
- SendClientFormat(playerid, GOLD, "Você foi até à posição do(a) jogador(a) %s[%i].", Nome(ID), ID);
- format(String, sizeof(String), "O(A) Staff %s foi até à posição do jogador %s.", Nome(playerid), Nome(ID));
- }
- return 1;
- }
- else SendClientMessage(playerid, VERMELHO, "Jogador não conectado!");
- return 1;
- }
- else SendClientMessage(playerid, VERMELHO, "Você não tem permissão!");
- return 1;
- }
- CMD:trazer(playerid, params[])
- {
- new
- Float: X,
- Float: Y,
- Float: Z,
- ID;
- if(Jogador[playerid][Admin] > 0)
- {
- if(sscanf(params, "d", ID)) return SendClientMessage(playerid, VERMELHO, "Use: /trazer (id)");
- if(IsPlayerConnected(ID))
- {
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerInterior(ID, GetPlayerInterior(playerid));
- SetPlayerPos(ID, X+2, Y+2, Z);
- if(Jogador[playerid][Admin] == 1)
- {
- SendClientFormat(ID, GOLD, "O(A) Ajudante %s trouxe você até ele!", Nome(playerid));
- SendClientFormat(playerid, GOLD, "Você trouxe o(a) jogador(a) %s[%i].", Nome(ID), ID);
- format(String, sizeof(String), "O(A) Ajudante %s trouxe o jogador %s até ele.", Nome(playerid), Nome(ID));
- }
- if(Jogador[playerid][Admin] == 2)
- {
- SendClientFormat(ID, GOLD, "O(A) Moderador(a) %s trouxe você até ele!", Nome(playerid));
- SendClientFormat(playerid, GOLD, "Você trouxe o(a) jogador(a) %s[%i].", Nome(ID), ID);
- format(String, sizeof(String), "O(A) Moderador(a) %s trouxe o jogador %s até ele.", Nome(playerid), Nome(ID));
- }
- if(Jogador[playerid][Admin] == 3)
- {
- SendClientFormat(ID, GOLD, "O(A) Administrador(a) %s trouxe você até ele!", Nome(playerid));
- SendClientFormat(playerid, GOLD, "Você trouxe o(a) jogador(a) %s[%i].", Nome(ID), ID);
- format(String, sizeof(String), "O(A) Administrador(a) %s trouxe o jogador %s até ele.", Nome(playerid), Nome(ID));
- }
- if(Jogador[playerid][Admin] == 4)
- {
- SendClientFormat(ID, GOLD, "O(A) Staff %s trouxe você até ele!", Nome(playerid));
- SendClientFormat(playerid, GOLD, "Você trouxe o(a) jogador(a) %s[%i].", Nome(ID), ID);
- format(String, sizeof(String), "O(A) Staff %s trouxe o jogador %s até ele.", Nome(playerid), Nome(ID));
- }
- return 1;
- }
- else SendClientMessage(playerid, VERMELHO, "Jogador não conectado!");
- return 1;
- }
- else SendClientMessage(playerid, VERMELHO, "Você não tem permissão!");
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- new ID;
- new motivo[15];
- if(Jogador[playerid][Admin] >= 3)
- {
- if(sscanf(params, "us", ID, motivo)) return SendClientMessage(playerid, VERMELHO, "Use: /ban (id) (Motivo)");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, VERMELHO, "Jogador não conectado!");
- if(Jogador[playerid][Admin] == 3)
- {
- SendClientFormatToAll(VERMELHO, "O(A) Administrador(a) %s baniu o(a) jogador(a) %s ( Motivo: %s )", Nome(playerid), Nome(ID), motivo);
- }
- if(Jogador[playerid][Admin] == 4)
- {
- SendClientFormatToAll(VERMELHO, "O(A) Staff %s baniu o(a) jogador(a) %s ( Motivo: %s )", Nome(playerid), Nome(ID), motivo);
- }
- format(StringContas, sizeof(StringContas), "Banidos/%s.ini", Nome(ID));
- getdate(Ano, Mes, Dia);
- gettime(Hora, Minuto, Segundo);
- DOF2_CreateFile(StringContas);
- DOF2_SetString(StringContas, "Admin", Nome(playerid));// Irá Criar Quem Baniu / Motivo / Dia / Mes / Ano / Hora / Minuto / etc...
- DOF2_SetString(StringContas, "Motivo", motivo);
- DOF2_SetInt(StringContas, "Dia", Dia);
- DOF2_SetInt(StringContas, "Mês", Mes);
- DOF2_SetInt(StringContas, "Ano", Ano);
- DOF2_SetInt(StringContas, "Hora", Hora);
- DOF2_SetInt(StringContas, "Minuto", Minuto);
- DOF2_SaveFile();
- KickEx(ID);
- }
- else
- {
- SendClientMessage(playerid, VERMELHO, "Você não tem permissão!");
- return 1;
- }
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- new
- ID,
- Motivo[80];
- if(Jogador[playerid][Admin] > 0)
- {
- if(sscanf(params, "us", ID, Motivo)) return SendClientMessage(playerid, VERMELHO, "Use: /Kick (id) (Motivo)");
- if(IsPlayerConnected(ID))
- {
- if(Jogador[playerid][Admin] == 1)
- {
- SendClientFormatToAll(VERMELHO, "O(A) Ajudante %s kickou o(a) jogador(a) %s ( Motivo: %s )", Nome(playerid), Nome(ID), Motivo);
- }
- if(Jogador[playerid][Admin] == 2)
- {
- SendClientFormatToAll(VERMELHO, "O(A) Moderador(a) %s kickou o(a) jogador(a) %s ( Motivo: %s )", Nome(playerid), Nome(ID), Motivo);
- }
- if(Jogador[playerid][Admin] == 3)
- {
- SendClientFormatToAll(VERMELHO, "O(A) Administrador(a) %s kickou o(a) jogador(a) %s ( Motivo: %s )", Nome(playerid), Nome(ID), Motivo);
- }
- if(Jogador[playerid][Admin] == 4)
- {
- SendClientFormatToAll(VERMELHO, "O(A) Staff %s kickou o(a) jogador(a) %s ( Motivo: %s )", Nome(playerid), Nome(ID), Motivo);
- }
- KickEx(ID);
- }
- else SendClientMessage(playerid, VERMELHO, "Jogador não conectado!");
- return 1;
- }
- else SendClientMessage(playerid, VERMELHO, "Você não tem permissão!");
- return 1;
- }
- //=======================================================================================================//
- stock Nome(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- public Kicka(p)
- {
- Kick(p);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment