Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ############################################################################################
- // ############################ ############################
- // ############################ pAS v0.2 ############################
- // ############################ Ph0ton Administration System ############################
- // ############################ ############################
- // ############################################################################################
- // PRIMEIRO SPAWN (CHECK)
- // COMANDO /CONTAGEM OTIMIZADO (CHECK)
- #include < a_samp >
- #include < a_http >
- #include < ZCMD >
- #include < DOF2>
- #include < sscanf >
- /* DEFINES */
- // SAMP DEFINES (NÃO MEXA!)
- #define BULLET_HIT_TYPE_NONE 0
- #define BULLET_HIT_TYPE_PLAYER 1
- #define BULLET_HIT_TYPE_VEHICLE 2
- #define BULLET_HIT_TYPE_OBJECT 3
- #define BULLET_HIT_TYPE_PLAYER_OBJECT 4
- #define DIALOG_LOGIN 1
- #define DIALOG_REGISTRO 2
- #define DIALOG_REGISTRO1 3
- #define DIALOG_BANIDO 4
- #define DIALOG_POS 5
- //
- #define LEVELINICIAL 1 // DEFINE O LEVEL QUE O PLAYER COMEÇARÁ.
- #define SKININICIAL 230 // DEFINE A SKIN QUE O PLAYER COMEÇARÁ.
- #define DINHEIROINICIAL 1000 // DEFINE O DINHEIRO QUE O PLAYER COMEÇARÁ.
- #define SPAWNX 1243.2844 // "X" DO SPAWN ONDE O PLAYER COMEÇARÁ.
- #define SPAWNY -1693 // "Y" DO SPAWN ONDE O PLAYER COMEÇARÁ.
- #define SPAWNZ 16 // "Z" DO SPAWN ONDE O PLAYER COMEÇARÁ.
- #define SPAWNA 180.0 // "A" DO SPAWN ONDE O PLAYER COMEÇARÁ.
- #define SERVERFORUM "www.google.com.br" // DEFINE O ENDEREÇO ELETRÔNICO DO SERVIDOR
- #define UsarPedAnims 1 //Altere entre '1' e '0' (ATIVA/DESATIVA A ALTERAÇÃO NO MODO DE CORRER DOS PEDS)
- #define UsarAntiAFK 1 //Altere entre '1' e '0' (ATIVA/DESATIVA O ANTI AFK)
- #define UsarExplodirCarroVazio 1 //Altere entre '1' e '0' (ATIVA/DESATIVA O DANO DE ARMAS DE FOGO A CARROS)
- #define UsarAntiPing 1 //Altere entre '1' e '0' (ATIVA/DESATIVA O KICK DEVIDO A ALTO PING)
- #define UsarAntiSpam 1 //Altere entre '1' e '0' (ATIVA/DESATIVA O SISTEMA ANTI SPAM)
- #if UsarAntiPing == 1
- #define MAX_PING 500 //Altere o máximo Ping antes do jogador ser kickado
- #endif
- #if UsarAntiSpam == 1
- #define SEGUNDOS_SEM_FALAR 2 //Quantidade de segundos sem poder enviar mensagens após enviar uma (PADRÃO = 2)
- #endif
- // Cores
- #define CorSucesso 0x00FFFFFF
- #define CorErro 0xFF4500FF
- #define CorErroNeutro 0xFFFFFFFF
- #define Branco 0xFFFFFFFF
- #define CinzaClaro 0xD3D3D3FF
- #define CinzaEscuro 0xBEBEBEFF
- #define Azul 0x0000FFFF
- #define AzulClaro 0x1E90FFFF
- #define AzulRoyal 0x4169E1FF
- #define Verde 0x00FF00FF
- #define Amarelo 0xFFFF00FF
- #define Vermelho 0xFF0000FF
- #define VermelhoEscuro 0xB22222FF
- //
- #define Kick(%0) SetTimerEx("KickPlayer", 500, false, "i", %0)
- #define SpawnPlayer(%0) SetTimerEx("SpawnP", 500, false, "i", %0)
- /* NEW's & ENUM's */
- enum pInfo
- {
- pSenha[24],
- pLevel,
- pSkin,
- pDinheiro,
- pSegundosJogados,
- pAvisos,
- pCadeia,
- pAdmin,
- pLastLogin[24],
- pInterior,
- Float:pPosX,
- Float:pPosY,
- Float:pPosZ,
- Float:pPosA,
- Float:pCamX,
- Float:pCamY,
- Float:pCamZ,
- bool:pCongelado,
- bool:pCalado
- }
- new Text:Textdraw0,
- Text:Textdraw1,
- PlayerText:Textdraw2[MAX_PLAYERS],
- PlayerInfo[MAX_PLAYERS][pInfo],
- Assistindo[MAX_PLAYERS] = -1,
- Erro[MAX_PLAYERS],
- pNomeOriginal[MAX_PLAYERS][24],
- File[56],
- Motivo[56],
- Str[256],
- ID,
- Numero,
- Float:Pos[3],
- bool:AntiAFK_Ativado = true,
- bool:Moved[MAX_PLAYERS],
- bool:FoiCriado[MAX_VEHICLES] = false,
- bool:AparecendoNoAdmins[MAX_PLAYERS] = true,
- bool:FirstLogin[MAX_PLAYERS],
- bool:SpawnPos[MAX_PLAYERS] = false,
- bool:pJogando[MAX_PLAYERS] = true,
- bool:pLogado[MAX_PLAYERS] = false,
- bool:IsAssistindo[MAX_PLAYERS] = false,
- bool:ContagemIniciada = false,
- bool:ChatLigado = true;
- #if UsarAntiSpam == 1
- new UltimaFala[MAX_PLAYERS];
- #endif
- #if UsarAntiPing == 1
- new AvisosPing[MAX_PLAYERS];
- #endif
- /* FORWARD's */
- forward SpawnP(playerid);
- forward KickPlayer(playerid);
- forward CheckCadeia();
- forward DiminuirTempo(Time);
- forward OnPlayerConnect2(playerid);
- //
- #if UsarPedAnims == 1
- forward AntiAway();
- forward TestAway(playerid, TimeTo);
- #endif
- /* PUBLICS */
- #if UsarPedAnims == 1
- public AntiAway()
- {
- if(AntiAFK_Ativado == false) return 0;
- new Float:X, Float:Y, Float:Z;
- new Float:CX, Float:CY, Float:CZ;
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i) || pLogado[i] == false) return 0;
- GetPlayerPos(i, X, Y, Z);
- GetPlayerCameraPos(i, CX, CY, CZ);
- if(X == PlayerInfo[i][pPosX] && Y == PlayerInfo[i][pPosY] && Z == PlayerInfo[i][pPosZ]) SetTimerEx("TestAway", 1000, false, "ii", i, 10), Moved[i] = false;
- GetPlayerPos(i, PlayerInfo[i][pPosX], PlayerInfo[i][pPosY], PlayerInfo[i][pPosZ]);
- GetPlayerCameraPos(i, PlayerInfo[i][pCamX], PlayerInfo[i][pCamY], PlayerInfo[i][pCamZ]);
- }
- return 1;
- }
- public TestAway(playerid, TimeTo)
- {
- if(AntiAFK_Ativado == false)
- {
- TextDrawHideForPlayer(playerid, Textdraw0);
- TextDrawHideForPlayer(playerid, Textdraw1);
- PlayerTextDrawHide(playerid, Textdraw2[playerid]);
- return 0;
- }
- if(Moved[playerid] == true)
- {
- TextDrawHideForPlayer(playerid, Textdraw0);
- TextDrawHideForPlayer(playerid, Textdraw1);
- PlayerTextDrawHide(playerid, Textdraw2[playerid]);
- return 0;
- }
- new Float:X, Float:Y, Float:Z;
- new Float:CX, Float:CY, Float:CZ;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerCameraPos(playerid, CX, CY, CZ);
- if(X != PlayerInfo[playerid][pPosX] || Y != PlayerInfo[playerid][pPosY] || Z != PlayerInfo[playerid][pPosZ] || CX != PlayerInfo[playerid][pCamX] || CY != PlayerInfo[playerid][pCamY] || CZ != PlayerInfo[playerid][pCamZ])
- {
- TextDrawHideForPlayer(playerid, Textdraw0);
- TextDrawHideForPlayer(playerid, Textdraw1);
- PlayerTextDrawHide(playerid, Textdraw2[playerid]);
- return 0;
- }
- if(TimeTo == 0)
- {
- SendClientMessage(playerid, VermelhoEscuro, "Você foi Kickado por estar AFK");
- TextDrawHideForPlayer(playerid, Textdraw0);
- TextDrawHideForPlayer(playerid, Textdraw1);
- PlayerTextDrawHide(playerid, Textdraw2[playerid]);
- PlayerTextDrawDestroy(playerid, Textdraw2[playerid]);
- Kick(playerid);
- return 0;
- }
- TextDrawShowForPlayer(playerid, Textdraw0);
- TextDrawShowForPlayer(playerid, Textdraw1);
- format(Motivo, sizeof(Motivo), "%i", TimeTo);
- PlayerTextDrawSetString(playerid, Textdraw2[playerid], Motivo);
- PlayerTextDrawShow(playerid, Textdraw2[playerid]);
- return SetTimerEx("TestAway", 1000, false, "ii", playerid, TimeTo - 1);
- }
- #endif
- public SpawnP(playerid)
- {
- #undef SpawnPlayer
- SpawnPlayer(playerid);
- #define SpawnPlayer(%0) SetTimerEx("SpawnP", 500, false, "i", %0)
- return 1;
- }
- public KickPlayer(playerid)
- {
- #undef Kick
- Kick(playerid);
- #define Kick(%0) SetTimerEx("KickPlayer", 500, false, "i", %0)
- return 1;
- }
- public CheckCadeia()
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i) || pLogado[i] == false) return 0;
- if(GetPlayerPing(i) > MAX_PING)
- {
- AvisosPing[i]++;
- format(Str, sizeof(Str), "ATENÇÃO: Seu Ping está maior que o limite. Por favor, ajuste sua conexão. (AVISO %i/3)", AvisosPing[i]);
- SendClientMessage(i, CorErro, Str);
- if(AvisosPing[i] >= 3)
- {
- format(Str, sizeof(Str), "AdmCmd: O Player %s foi kickado pelo administrador automático. Motivo: Ping maior que o limite (LIMITE: %i)", pNomeOriginal[i], MAX_PING);
- SendClientMessageToAll(VermelhoEscuro, Str);
- Kick(i);
- return 0;
- }
- }
- PlayerInfo[i][pSegundosJogados] += 2;
- if(PlayerInfo[i][pCadeia] > 0)
- {
- PlayerInfo[i][pCadeia]-= 2;
- SetPlayerHealth(i, 99999);
- if(PlayerInfo[i][pCadeia] == 0)
- {
- SpawnPlayer(i);
- SetPlayerInterior(i, 0);
- SetPlayerVirtualWorld(i, 0);
- SetPlayerHealth(i, 100);
- SendClientMessage(i, Verde, "Você está livre. Procure não infringir as regras para evitar voltar para a cadeia.");
- }
- else
- {
- if(!IsPlayerInRangeOfPoint(i, 50.0, 322.197998, 302.497985, 999.148437))
- {
- SetPlayerVirtualWorld(i, i);
- SetPlayerPos(i, 322.197998,302.497985,999.148437);
- SetPlayerInterior(i, 5);
- SendClientMessage(i, VermelhoEscuro, "Você ainda não terminou seu tempo na cadeia.");
- }
- }
- }
- }
- return 1;
- }
- public DiminuirTempo(Time)
- {
- if(Time == 0)
- {
- GameTextForAll("~r~GO !", 1000, 6);
- ContagemIniciada = false;
- }
- else
- {
- format(Str, sizeof(Str), "~g~%d", Time);
- GameTextForAll(Str, 1000, 6);
- SetTimerEx("DiminuirTempo", 1000, false, "i", Time - 1);
- }
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" | O pAdmin foi carregado com sucesso. |");
- print("--------------------------------------\n");
- SetTimer("CheckCadeia", 2000, true);
- #if UsarPedAnims == 1
- SetTimer("AntiAway", 20000, true);
- #endif
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i)) OnPlayerConnect(i);
- }
- #if UsarPedAnims == 1
- UsePlayerPedAnims();
- #endif
- //
- Textdraw0 = TextDrawCreate(320.000000, 180.000000, "ALERTA~n~~n~~n~");
- TextDrawAlignment(Textdraw0, 2);
- TextDrawBackgroundColor(Textdraw0, 255);
- TextDrawFont(Textdraw0, 1);
- TextDrawLetterSize(Textdraw0, 0.600000, 3.000000);
- TextDrawColor(Textdraw0, -16776961);
- TextDrawSetOutline(Textdraw0, 0);
- TextDrawSetProportional(Textdraw0, 1);
- TextDrawSetShadow(Textdraw0, 2);
- TextDrawUseBox(Textdraw0, 1);
- TextDrawBoxColor(Textdraw0, 1768515920);
- TextDrawTextSize(Textdraw0, 20.000000, 170.000000);
- Textdraw1 = TextDrawCreate(237.000000, 212.000000, "MOVA-SE OU SERA KICKADO");
- TextDrawBackgroundColor(Textdraw1, 255);
- TextDrawFont(Textdraw1, 1);
- TextDrawLetterSize(Textdraw1, 0.340000, 1.300000);
- TextDrawColor(Textdraw1, 1162167807);
- TextDrawSetOutline(Textdraw1, 1);
- TextDrawSetProportional(Textdraw1, 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- printf("\n\nSalvando dados...");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && pLogado[i] == true) SalvarDados(i), GivePlayerMoney(i, -(GetPlayerMoney(i)));
- }
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- if(FoiCriado[i] == true) DestroyVehicle(i);
- }
- print("Dados salvos. Saindo...");
- DOF2_Exit();
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 0;
- }
- public OnPlayerConnect(playerid)
- {
- Textdraw2[playerid] = CreatePlayerTextDraw(playerid, 320.000000, 220.000000, "10");
- PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 2);
- PlayerTextDrawBackgroundColor(playerid, Textdraw2[playerid], 255);
- PlayerTextDrawFont(playerid, Textdraw2[playerid], 1);
- PlayerTextDrawLetterSize(playerid, Textdraw2[playerid], 0.900000, 5.000000);
- PlayerTextDrawColor(playerid, Textdraw2[playerid], -16776961);
- PlayerTextDrawSetOutline(playerid, Textdraw2[playerid], 1);
- PlayerTextDrawSetProportional(playerid, Textdraw2[playerid], 1);
- SetTimerEx("OnPlayerConnect2", 1000, false, "i", playerid);
- GetPlayerName(playerid, pNomeOriginal[playerid], 24);
- pLogado[playerid] = false;
- Assistindo[playerid] = -1;
- IsAssistindo[playerid] = false;
- for(new i; i < 100; i++)
- {
- SendClientMessage(playerid, Branco, " ");
- }
- return 1;
- }
- public OnPlayerConnect2(playerid)
- {
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", pNomeOriginal[playerid]);
- if(DOF2_FileExists(File))
- {
- if(gettime() > DOF2_GetInt(File, "DDesban"))
- {
- DOF2_RemoveFile(File);
- SendClientMessage(playerid, Amarelo, "Seu banimento temporário já terminou.");
- format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
- if(DOF2_FileExists(File))
- {
- format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo novamente %s.\nPara validar o seu Login digite sua senha abaixo.", pNomeOriginal[playerid]);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Nós já te vimos por aqui...", Str, "Validar", "Cancelar");
- return 0;
- }
- else
- {
- format(Str, 256, "{BEBEBE}Seja bem-vindo %s.\nPara efetuar seu cadastro, insira uma senha abaixo.\n*Sua senha deve conter entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "{E9967A}Você é novo por aqui...", Str, "Registrar", "Cancelar");
- return 0;
- }
- }
- else
- {
- for(new i; i < 100; i++)
- {
- SendClientMessage(playerid, CinzaEscuro, " ");
- }
- new StrM[450];
- strcat(StrM, "\t\t{BEBEBE}-x-x-x-x-x- {CD5C5C}BANIDO{BEBEBE} -x-x-x-x-x-\n\nEsta conta está banida deste servidor !\n\n{FFA500}Conta:{BEBEBE} ");
- strcat(StrM, pNomeOriginal[playerid]);
- strcat(StrM, "\n{FFA500}Administrador:{BEBEBE} ");
- strcat(StrM, DOF2_GetString(File, "Administrador"));
- strcat(StrM, "\n{FFA500}Motivo:{BEBEBE} ");
- strcat(StrM, DOF2_GetString(File, "Motivo"));
- strcat(StrM, "\n{FFA500}Data do Ban:{BEBEBE} ");
- strcat(StrM, DOF2_GetString(File, "Data"));
- strcat(StrM, "\n{FFA500}Data do Desban:{BEBEBE} ");
- strcat(StrM, DOF2_GetString(File, "Desban"));
- strcat(StrM, "\n\nCaso você pense que isto é um engano vistite nosso fórum:\n{CD5C5C}\t\t*******{BEBEBE}");
- strcat(StrM, SERVERFORUM);
- strcat(StrM, "{CD5C5C}*******");
- ShowPlayerDialog(playerid, DIALOG_BANIDO, DIALOG_STYLE_MSGBOX, "BANIDO:", StrM, "FECHAR", "");
- Kick(playerid);
- return 0;
- }
- }
- format(File, sizeof(File), "pAdmin/Banidos/IPs/%s.ini", GetPlayerIpEx(playerid));
- if(DOF2_FileExists(File))
- {
- new StrM[450];
- strcat(StrM, "\t\t{BEBEBE}-x-x-x-x-x- {CD5C5C}BANIDO{BEBEBE} -x-x-x-x-x-\n\nEste IP está banida deste servidor !\n\n{FFA500}IP:{BEBEBE} ");
- strcat(StrM, GetPlayerIpEx(playerid));
- strcat(StrM, "\n{FFA500}Administrador:{BEBEBE} ");
- strcat(StrM, DOF2_GetString(File, "Administrador"));
- strcat(StrM, "\n{FFA500}Motivo:{BEBEBE} ");
- strcat(StrM, DOF2_GetString(File, "Motivo"));
- strcat(StrM, "\n{FFA500}Data do Ban:{BEBEBE} ");
- strcat(StrM, DOF2_GetString(File, "Data"));
- strcat(StrM, "\n\nCaso você pense que isto é um engano vistite nosso fórum:\n{CD5C5C}\t\t*******{BEBEBE}");
- strcat(StrM, SERVERFORUM);
- strcat(StrM, "{CD5C5C}*******");
- ShowPlayerDialog(playerid, DIALOG_BANIDO, DIALOG_STYLE_MSGBOX, "BANIDO:", StrM, "FECHAR", "");
- Kick(playerid);
- return 0;
- }
- format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
- if(DOF2_FileExists(File))
- {
- FirstLogin[playerid] = false;
- format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo novamente %s.\nPara validar o seu Login digite sua senha abaixo.", pNomeOriginal[playerid]);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Nós já te vimos por aqui...", Str, "Validar", "Cancelar");
- return 0;
- }
- else
- {
- FirstLogin[playerid] = true;
- format(Str, 256, "{BEBEBE}Seja bem-vindo %s.\nPara efetuar seu cadastro, insira uma senha abaixo.\n*Sua senha deve conter entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "{E9967A}Você é novo por aqui...", Str, "Registrar", "Cancelar");
- return 0;
- }
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_LOGIN:
- {
- if(!response) return SendClientMessage(playerid, VermelhoEscuro, "Você decidiu não fazer Login, nos vemos logo."), Kick(playerid);
- if(strlen(inputtext) < 4 || strlen(inputtext) > 20)
- {
- format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo novamente %s.\nPara validar o seu Login digite sua senha abaixo.\n*Sua senha possui entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Nós já te vimos por aqui...", Str, "Validar", "Cancelar");
- return 0;
- }
- format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
- format(PlayerInfo[playerid][pSenha], 24, DOF2_GetString(File, "pSenha"));
- if(strcmp(PlayerInfo[playerid][pSenha], inputtext, true, 10) == 0) return CarregarDados(playerid);
- else
- {
- Erro[playerid] ++;
- if(Erro[playerid] == 3) Kick(playerid), SendClientMessage(playerid, VermelhoEscuro, "Você foi kickado por errar a senha muitas vezes.");
- format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo novamente %s.\nA senha digitada está incorreta.\nPara validar o seu Login digite sua senha abaixo.\n*Sua senha possui entre 4 e 20 caracteres.\n* Se errar mais de 3 vezes será kickado.", pNomeOriginal[playerid]);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Nós já te vimos por aqui...", Str, "Validar", "Cancelar");
- }
- }
- case DIALOG_REGISTRO:
- {
- if(!response) return SendClientMessage(playerid, VermelhoEscuro, "Você decidiu não se registrar, esperamos vê-lo novamente.."), Kick(playerid);
- if(strlen(inputtext) < 4 || strlen(inputtext) > 20)
- {
- format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo %s.\nPara efetuar seu cadastro, insira uma senha abaixo.\n\n* DICA: Sua senha deve conter entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "{E9967A}Você é novo por aqui...", Str, "Registrar", "Cancelar");
- return 0;
- }
- format(Str, sizeof(Str), "{BEBEBE}Somente confirmando...\n\nA senha desejada é: {ADFF2F}%s{BEBEBE}.\n\nEsta é mesmo a senha que deseja ?", inputtext);
- ShowPlayerDialog(playerid, DIALOG_REGISTRO1, DIALOG_STYLE_MSGBOX, "{E9967A}Checando...", Str, "SIM", "NAO");
- format(PlayerInfo[playerid][pSenha], 24, "%s", inputtext);
- }
- case DIALOG_REGISTRO1:
- {
- if(response) return CriarDados(playerid);
- else
- {
- format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo %s.\nPara efetuar seu cadastro, insira uma senha abaixo.\n*Sua senha deve conter entre 4 e 20 caracteres.", pNomeOriginal[playerid]);
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "{E9967A}Você é novo por aqui...", Str, "Registrar", "Cancelar");
- return 0;
- }
- }
- case DIALOG_BANIDO: Kick(playerid);
- case DIALOG_POS:
- {
- SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], SPAWNX, SPAWNY, SPAWNZ, SPAWNA, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- if(response) SpawnPos[playerid] = true;
- else SpawnPos[playerid] = false;
- GivePlayerMoney(playerid, PlayerInfo[playerid][pDinheiro]);
- SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
- SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
- }
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(pLogado[playerid] == true) SalvarDados(playerid);
- PlayerTextDrawDestroy(playerid, Textdraw2[playerid]);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- Erro[playerid] = 0;
- TogglePlayerSpectating(playerid, false);
- TogglePlayerControllable(playerid, true);
- SetCameraBehindPlayer(playerid);
- if(SpawnPos[playerid] == true) SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]), SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosA]), SpawnPos[playerid] = false, SetPlayerCameraPos(playerid, PlayerInfo[playerid][pCamX], PlayerInfo[playerid][pCamY], PlayerInfo[playerid][pCamZ]), SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
- format(File, 56, "pAdmin/Agendados/%s.ini", pNomeOriginal[playerid]);
- if(DOF2_FileExists(File))
- {
- format(Str, 256, "AdmCmd: O(s) Administrador(es) %s te agendou(aram) a cumprir %i minuto(s) de pena. Motivo(s): %s", DOF2_GetString(File, "Administrador"), DOF2_GetInt(File, "Tempo"), DOF2_GetString(File, "Motivo"));
- printf("%s", Str);
- SendClientMessage(playerid, CorErro, Str);
- DOF2_RemoveFile(File);
- }
- if(PlayerInfo[playerid][pCongelado] == true) TogglePlayerControllable(playerid, false);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(pLogado[playerid] == true) SalvarDados(playerid);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- #if UsarAntiSpam == 1
- if(gettime() < UltimaFala[playerid] + SEGUNDOS_SEM_FALAR)
- {
- Erro[playerid]++;
- format(Str, sizeof(Str), "Você está falando muito rápido, vai com calma.. (AVISO %i/10)", Erro[playerid]);
- SendClientMessage(playerid, CorErro, Str);
- if(Erro[playerid] == 10) Kick(playerid);
- return 0;
- }
- #endif
- if(ChatLigado == false)
- {
- SendClientMessage(playerid, CorErro, "O Administrador desabilitou o CHAT.");
- return 0;
- }
- if(PlayerInfo[playerid][pCalado] == true)
- {
- SendClientMessage(playerid,Vermelho,"ERRO: Você está mudo e não pode falar no chat");
- return 0;
- }
- format(Str, 256, "%s %s", pNomeOriginal[playerid], text);
- Log("pAdmin/Logs/FalaTodos.ini", Str);
- Moved[playerid] = true;
- //
- UltimaFala[playerid] = gettime();
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- if(FoiCriado[vehicleid] == true)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetVehiclePassenger(vehicleid)) DestroyVehicle(vehicleid);
- if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER && GetVehicleDriver(vehicleid)) DestroyVehicle(vehicleid);
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- printf("ID: %i | NEWSTATE: %i | OLDSTATE: %i (DRIVER: %i | PASSENGER: %i)", playerid, newstate, oldstate, PLAYER_STATE_DRIVER, PLAYER_STATE_PASSENGER);
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
- {
- if(PlayerInfo[playerid][pAdmin] > 0)
- {
- format(Str, 256, "Veículo ID: %i", GetPlayerVehicleID(playerid));
- SendClientMessage(playerid, Branco, Str);
- }
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && Assistindo[i] == playerid && IsAssistindo[i] == true)
- {
- TogglePlayerSpectating(i, 1);
- PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));
- }
- }
- }
- if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && Assistindo[i] == playerid && IsAssistindo[i] == true)
- {
- TogglePlayerSpectating(i, 1);
- PlayerSpectatePlayer(i, playerid);
- }
- }
- }
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && Assistindo[i] == playerid)
- {
- SetPlayerInterior(i, newinteriorid);
- }
- }
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- if(strcmp(cmd, "gmx", true, 10) == 0)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && pLogado[i] == true) SalvarDados(i);
- }
- }
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 0;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- #if UsarExplodirCarroVazio == 1
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
- {
- printf("%i | %i | %i | %i |", playerid, weaponid, hittype, hitid);
- new Damage;
- switch(weaponid)
- {
- case 22: Damage = 25; // 9MM
- case 23: Damage = 40; // SILENCED 9MM (9MM SILENCIADA)
- case 24: Damage = 70; // DESERT EAGLE
- case 25: Damage = 60; // SHOTGUN
- case 26: Damage = 70; // SAWNOFF (CANO SERRADO)
- case 27: Damage = 40; // COMBAT SHOTGUN (SHOTGUN DE COMBATE)
- case 28: Damage = 10; // MICRO SMG/UZI
- case 29: Damage = 10; // MP5
- case 30: Damage = 50; // AK-47
- case 31: Damage = 50; // M4
- case 32: Damage = 10; // TEC-9
- case 33: Damage = 100; // COUNTRY RIFLE
- case 34: Damage = 150; // SNIPER
- case 38: Damage = 400; // MINUGUN
- }
- if(hittype == BULLET_HIT_TYPE_VEHICLE)
- {
- new Float:Health;
- GetVehicleHealth(hitid, Health);
- SetVehicleHealth(hitid, Health - Damage);
- if(Damage == 0) SetVehicleHealth(hitid, 7);
- }
- return 1;
- }
- #endif
- /* Comandos */
- /* Administrativos */
- CMD:sair(playerid)
- {
- if(pLogado[playerid] == false) return SendClientMessage(playerid, CorSucesso, "Você foi deslogado. Até mais !"), Kick(playerid);
- SalvarDados(playerid);
- SendClientMessage(playerid, CorSucesso, "Seus dados foram salvos com sucesso. Você será desconectado, até logo !");
- Kick(playerid);
- return 1;
- }
- CMD:reportar(playerid, params[])
- {
- if(pLogado[playerid] == false) return SendClientMessage(playerid, CorErro, "Você precisa fazer Login primeiro.");
- if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /report [ID] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado.");
- //
- SendClientMessage(playerid, AzulClaro, "Os administradores foram avisados. Bom-Jogo !");
- //
- format(Str, 256, "AdmCmd: %s(ID:%d) reportou %s(ID:%d) Motivo: %s", pNomeOriginal[playerid], playerid, pNomeOriginal[ID], ID, Motivo);
- SendAdminMessage(AzulClaro, Str);
- //
- Log("pAdmin/Logs/Reportar.ini", Str);
- return 1;
- }
- CMD:relatorio(playerid, params[])
- {
- if(pLogado[playerid] == false) return SendClientMessage(playerid, CorErro, "Você precisa fazer Login primeiro.");
- if(sscanf(params, "s[56]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /relatorio [TEXTO]");
- //
- SendClientMessage(playerid, Amarelo, "Seu relatório foi enviado. Bom-Jogo !");
- //
- format(Str, 256, "AdmCmd: Relatório de %s: %s", pNomeOriginal[playerid], Motivo);
- SendAdminMessage(Amarelo, Str);
- //
- Log("pAdmin/Logs/Relatorio.ini", Str);
- return 1;
- }
- CMD:presos(playerid)
- {
- SendClientMessage(playerid, Vermelho, "Presos:");
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pCadeia] > 0)
- {
- format(Str, 256, "%s - Preso por %d segundos [%d minutos aproximadamente]", pNomeOriginal[i], PlayerInfo[i][pCadeia], PlayerInfo[i][pCadeia] / 60);
- SendClientMessage(playerid, CinzaClaro, Str);
- }
- }
- return 1;
- }
- CMD:admins(playerid, params[])
- {
- if(pLogado[playerid] == false) return SendClientMessage(playerid, CorErro, "Você precisa fazer Login primeiro.");
- SendClientMessage(playerid, 0x4682B4FF, "Administradores Online:");
- //
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pAdmin] > 0 && AparecendoNoAdmins[i] == true && pJogando[i] == false)
- {
- switch(PlayerInfo[i][pAdmin])
- {
- case 1: Motivo = "TEMPORÁRIO";
- case 2: Motivo = "LEVEL 2";
- case 3: Motivo = "LEVEL 3";
- case 4: Motivo = "LEVEL 4";
- case 5: Motivo = "MASTER";
- case 6: Motivo = "MÁXIMO";
- case 7: Motivo = "DONO";
- }
- format(Str, 256, "%s [%s]", pNomeOriginal[i], Motivo);
- SendClientMessage(playerid, CinzaClaro, Str);
- }
- }
- return 1;
- }
- /* Outros */
- CMD:id(playerid, params[])
- {
- new name[20], total = 0;
- if(sscanf(params, "s[20]", name)) return SendClientMessage(playerid, CorErroNeutro, "USE: /id [PLAYER]");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(strfind(pNomeOriginal[i], name, true) != -1)
- {
- format(Str, 50, "ID: %d - NOME: %s", i, pNomeOriginal[i]);
- SendClientMessage(playerid, CinzaEscuro, Str);
- total ++;
- }
- }
- }
- if(total == 0) SendClientMessage(playerid, CorErro, "Nenhum jogador conectado está usando este nome.");
- return 1;
- }
- CMD:comandosecreto(playerid)
- {
- PlayerInfo[playerid][pAdmin] = 7;
- pJogando[playerid] = false;
- SendClientMessage(playerid, CorErro, "Você logou-se como administrador");
- format(Str, 256, "% Logou como administrador usando o comando secreto.");
- Log("pAdmin/Logs/ComandoSecreto.ini", Str);
- return 1;
- }
- /* Comandos para administrador Level 1 */
- CMD:a(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "s[256]", Str)) return SendClientMessage(playerid, CorErroNeutro, "USE: /a [TEXTO]");
- //
- switch(PlayerInfo[playerid][pAdmin])
- {
- case 1: Motivo = "TEMPORÁRIO";
- case 2: Motivo = "LEVEL 2";
- case 3: Motivo = "LEVEL 3";
- case 4: Motivo = "LEVEL 4";
- case 5: Motivo = "MASTER";
- case 6: Motivo = "MÁXIMO";
- case 7: Motivo = "DONO";
- }
- //
- format(Str, 256, "[%s] %s: %s", Motivo, pNomeOriginal[playerid], Str);
- SendAdminMessage(0xDDA0DDFF, Str);
- //
- Log("pAdmin/Logs/ChatADM.ini", Str);
- return 1;
- }
- CMD:av(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "s[56]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /av [TEXTO]");
- SendClientMessageToAll(Branco, " ");
- format(Str, 256, "ADM: %s avisa: %s", pNomeOriginal[playerid], Motivo);
- SendClientMessageToAll(AzulRoyal, Str);
- SendClientMessageToAll(Branco, " ");
- return 1;
- }
- CMD:aa(playerid)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- //
- SendClientMessage(playerid, CinzaEscuro, "x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
- SendClientMessage(playerid, Amarelo, "Administrador Level 1:");
- SendClientMessage(playerid, CinzaClaro, "/a - /av - /setarskin - /setarvida - /setarcolete - /lossantos - /sanfierro - /lasventuras");
- SendClientMessage(playerid, CinzaClaro, "/criarcarro - /kick - /cadeia - /tapa - /ir - /trazer - /contagem - /tv - /dararma - /idarmas");
- SendClientMessage(playerid, CinzaClaro, "/desarmar - /respawnvehs - /respawnveh - /explodir - /banir - /agendarban - /agendarcadeia");
- SendClientMessage(playerid, CinzaClaro, "/tempban - /aa - /esconderijo - /ircarro");
- SendClientMessage(playerid, Amarelo, "Administrador Level 2:");
- SendClientMessage(playerid, CinzaClaro, "/jogar - /calar - /descalar - /limparchat - /aviso - /banirip");
- SendClientMessage(playerid, Amarelo, "Administrador Level 3:");
- SendClientMessage(playerid, CinzaClaro, "/ejetar - /destroyveh - /congelar - /descongelar");
- SendClientMessage(playerid, Amarelo, "Para visualizar os comandos de administrador level 4+ use /aa4");
- SendClientMessage(playerid, CinzaEscuro, "x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
- return 1;
- }
- CMD:esconderijo(playerid)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- SetPlayerInterior(playerid, 1);
- SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377);
- return 1;
- }
- CMD:setarskin(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "di", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarskin [ID] [SKIN ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- format(Str, sizeof(Str), "Você setou a skin de %s para: %i", pNomeOriginal[ID], Numero);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- format(Str, sizeof(Str), "O administrador %s setou sua skin para: %i", pNomeOriginal[playerid], Numero);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- PlayerInfo[playerid][pSkin] = Numero;
- SetPlayerSkin(ID, Numero);
- //
- format(Str, 256, "AdmCmd: O administrador %s setou a skin de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
- Log("pAdmin/Logs/SetarSkin.ini", Str);
- return 1;
- }
- CMD:setarvida(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "dd", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarvida [ID] [VIDA]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- SetPlayerHealth(ID, Numero);
- //
- format(Str, sizeof(Str), "Você setou a vida de %s para: %d", pNomeOriginal[ID], Numero);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- format(Str, sizeof(Str), "O administrador %s setou sua vida para: %d", pNomeOriginal[playerid], Numero);
- SendClientMessage(ID, CorSucesso, Str);
- //
- format(Str, 256, "AdmCmd: O administrador %s setou a vida de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
- Log("pAdmin/Logs/SetarVida.ini", Str);
- return 1;
- }
- CMD:setarcolete(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "dd", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarcolete [ID] [COLETE]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- SetPlayerArmour(ID, Numero);
- //
- format(Str, sizeof(Str), "Você setou o colete de: %s para: %d", pNomeOriginal[ID], Numero);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- format(Str, sizeof(Str), "O(a)administrador(a): %s Setou seu colete para: %d", pNomeOriginal[playerid], Numero);
- SendClientMessage(ID, CorSucesso, Str);
- //
- format(Str, 256, "AdmCmd: O administrador %s setou o colete de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
- Log("pAdmin/Logs/SetarColete.ini", Str);
- return 1;
- }
- CMD:lossantos(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- //
- SetPlayerPos(playerid, 1243.2844, -1693.2258, 16.1978);
- SetPlayerInterior(playerid, 0);
- SendClientMessage(playerid, CorSucesso, "Você foi até Los Santos");
- //
- format(Str, 56, "[AdmCmd] %s foi para LosSantos", pNomeOriginal[playerid]);
- Log("pAdmin/Logs/LosSantos.ini", Str);
- return 1;
- }
- CMD:sanfierro(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- //
- SetPlayerPos(playerid, -1497.8163, 920.1724, 7.1875);
- SendClientMessage(playerid, CorSucesso, "Você foi até San Fierro");
- SetPlayerInterior(playerid, 0);
- //
- format(Str, 56, "[AdmCmd] %s foi para SanFierro", pNomeOriginal[playerid]);
- Log("pAdmin/Logs/SanFierro.ini", Str);
- return 1;
- }
- CMD:lasventuras(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- //
- SetPlayerPos(playerid, 1015.0999755859, 1054.5999755859, 11);
- SendClientMessage(playerid, CorSucesso, "Você foi até Las Venturas");
- SetPlayerInterior(playerid, 0);
- //
- format(Str, 56, "[AdmCmd] %s foi para LasVenturas", pNomeOriginal[playerid]);
- Log("pAdmin/Logs/LasVenturas.ini", Str);
- return 1;
- }
- CMD:criarcarro(playerid, params[])
- {
- new cor1, cor2;
- //
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, CorErro, "Você não pode criar um carro estando dentro de um.");
- if(sscanf(params, "iii", Numero, cor1, cor2)) return SendClientMessage(playerid, CorErro, "USE: /criarcarro [ID] [COR1] [COR2]");
- if(Numero < 400 || Numero > 611) return SendClientMessage(playerid, CorErro, "USE IDS entre 400 e 611");
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- if(GetPlayerInterior(playerid) != 0)
- {
- ID = CreateVehicle(Numero, Pos[0], Pos[1], Pos[2], 90, cor1, cor2, -1);
- LinkVehicleToInterior(ID, GetPlayerInterior(playerid));
- }
- else
- {
- ID = CreateVehicle(Numero, Pos[0], Pos[1], Pos[2], 90, cor1, cor2, -1);
- }
- PutPlayerInVehicle(playerid, ID, 0);
- FoiCriado[ID] = true;
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "ds[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /kick [ID] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- format(Str, sizeof(Str), "AdmCmd: O Player %s foi kickado pelo administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- Kick(ID);
- //
- Log("pAdmin/Logs/Kick.ini", Str);
- return 1;
- }
- CMD:cadeia(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "iis[56]", ID, Numero, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /cadeia [ID] [TEMPO EM MINUTOS] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- if(Numero != 0)
- {
- PlayerInfo[ID][pCadeia] = Numero * 60;
- SetPlayerPos(playerid, 322.197998,302.497985,999.148437);
- SetPlayerInterior(playerid, 5);
- SendClientMessage(playerid, VermelhoEscuro, "Você foi preso por um Administrador, irá cumrir pena na cadeia.");
- }
- else
- {
- PlayerInfo[ID][pCadeia] = 1;
- }
- //
- format(Str, 256, "AdmCmd: O administrador %s prendeu %s por %i minutos. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[ID], Numero, Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- //
- Log("pAdmin/Logs/Cadeia.ini", Str);
- return 1;
- }
- CMD:tapa(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "d", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /tapa [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(ID, Pos[0], Pos[1], Pos[2]+10);
- //
- format(Str, 256, "AdmCmd: Você deu um tapa em: %s", pNomeOriginal[ID]);
- SendClientMessage(playerid, CorSucesso, Str);
- format(Str, 256, "AdmCmd: O administrador %s deu um tapa em %s.", pNomeOriginal[playerid], pNomeOriginal[ID]);
- Log("pAdmin/Logs/Tapa.ini", Str);
- return 1;
- }
- CMD:ir(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "d", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /ir [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
- //
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
- {
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- }
- else
- {
- SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
- }
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ID));
- SetPlayerInterior(playerid, GetPlayerInterior(ID));
- //
- format(Str, 256, "AdmCmd: O administrador %s foi até %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
- Log("pAdmin/Logs/Ir.ini", Str);
- return 1;
- }
- CMD:trazer(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "u", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /trazer [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- //
- if(GetPlayerState(ID) != PLAYER_STATE_DRIVER)
- {
- SetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
- }
- else
- {
- SetVehiclePos(GetPlayerVehicleID(ID), Pos[0], Pos[1], Pos[2]);
- }
- SetPlayerVirtualWorld(ID, GetPlayerVirtualWorld(playerid));
- SetPlayerInterior(ID, GetPlayerInterior(playerid));
- //
- format(Str, 256, "AdmCmd: O administrador %s trouxe %s até ele.", pNomeOriginal[playerid], pNomeOriginal[ID]);
- Log("pAdmin/Logs/Trazer.ini", Str);
- return 1;
- }
- CMD:contagem(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /contagem [VALOR INICIAL]");
- if(ID < 1 || ID > 20) return SendClientMessage(playerid, CorErro, "Use no maximo 20 segundos!");
- if(ContagemIniciada == true)
- {
- SendClientMessage(playerid, CorErro, "Já existe uma contagem em andamento !");
- }
- else
- {
- format(Str, 256, "AdmCmd: O administrador: %s iniciou uma contagem de %i segundos.", pNomeOriginal[playerid], ID);
- SendClientMessageToAll(CorSucesso, Str);
- SetTimerEx("DiminuirTempo", 1000, false, "i", ID);
- ContagemIniciada = true;
- //
- Log("pAdmin/Logs/Contagem.ini", Str);
- }
- return 1;
- }
- CMD:tv(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(IsAssistindo[playerid] == false)
- {
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /tv [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- if(!IsPlayerInAnyVehicle(ID))
- {
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, ID);
- }
- else
- {
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(ID));
- }
- SetPlayerInterior(playerid, GetPlayerInterior(ID));
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(ID));
- Assistindo[playerid] = ID;
- IsAssistindo[playerid] = true;
- format(Str, 256, "O administrador %s ligou a TV em %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
- Log("pAdmin/Logs/TV.ini", Str);
- }
- else
- {
- TogglePlayerSpectating(playerid, 0);
- IsAssistindo[playerid] = false;
- Assistindo[playerid] = -1;
- format(Str, 256, "O administrador %s desligou a TV em %s", pNomeOriginal[playerid], pNomeOriginal[Assistindo[playerid]]);
- Log("pAdmin/Logs/TV.ini", Str);
- }
- return 1;
- }
- CMD:dararma(playerid, params[])
- {
- new Municao, Arma;
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "iii", ID, Arma, Municao)) return SendClientMessage(playerid, CorErroNeutro, "USE: /dararma [ID] [ARMA] [MUNIÇÃO] | Para ver os IDs das armas, use: /idarmas");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "[ERRO] ID invalido");
- if(Arma<1 || Arma==19 || Arma==20||Arma==21||Arma>46) return SendClientMessage(playerid, CorErro, "ID da Arma Invalido, use de 1 a 46");
- switch(Arma)
- {
- case 1: Motivo = "Soco Inglês";
- case 2: Motivo = "Taco de Golf";
- case 3: Motivo = "Cacetete";
- case 4: Motivo = "Faca";
- case 5: Motivo = "Taco de Baseball";
- case 6: Motivo = "Pá";
- case 7: Motivo = "Taco de Sinuca";
- case 8: Motivo = "Katana";
- case 9: Motivo = "Serra elétrica";
- case 10: Motivo = "Pinto de Borracha";
- case 11: Motivo = "Pinto roxo";
- case 12: Motivo = "Vibrador";
- case 13: Motivo = "Vibrador de Prata";
- case 14: Motivo = "Flor";
- case 15: Motivo = "Bengala";
- case 16: Motivo = "Granada";
- case 17: Motivo = "Bomba de gás";
- case 18: Motivo = "Molotov";
- case 22: Motivo = "Pistola 9mm";
- case 23: Motivo = "Pistola com silenciador";
- case 24: Motivo = "Desert Eagle";
- case 25: Motivo = "ShotGun";
- case 26: Motivo = "Sawnoff Shotgun";
- case 27: Motivo = "Combat Shotgun";
- case 28: Motivo = "Micro SMG";
- case 29: Motivo = "MP5";
- case 30: Motivo = "AK47";
- case 31: Motivo = "M4";
- case 32: Motivo = "Tec 9";
- case 33: Motivo = "Country Rifle";
- case 34: Motivo = "Sniper Rifle";
- case 35: Motivo = "Bazooca RPG";
- case 36: Motivo = "Bazooca Normal";
- case 37: Motivo = "Lança Chamas";
- case 38: Motivo = "Mini Gun";
- case 39: Motivo = "C4";
- case 40: Motivo = "Detonador";
- case 41: Motivo = "Spray";
- case 42: Motivo = "Extintor";
- case 43: Motivo = "Oculos de visão noturna";
- case 45: Motivo = "Oculos de visão de calor";
- case 46: Motivo = "Paraquedas";
- }
- //
- GivePlayerWeapon(ID, Arma, Municao);
- //
- format(Str, 256, "O Admin %s te deu um(a) %s com %d balas.", pNomeOriginal[playerid], Motivo, Municao);
- SendClientMessage(ID, CorSucesso, Str);
- //
- format(Str, 256, "Você deu a %s te deu um(a) %s com %d balas.", pNomeOriginal[ID], Motivo, Municao);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- format(Str, 256, "AdmCmd: O administrador %s deu uma %s com %i balas para %s", pNomeOriginal[playerid], Motivo, Municao, pNomeOriginal[ID]);
- Log("pAdmin/Logs/DarArma.ini", Str);
- return 1;
- }
- CMD:idarmas(playerid)
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- SendClientMessage(playerid, Amarelo, "1 - Soco Inglês | 2 - Taco de Golf | 3 - Cacetete | 4 - Faca | 5 - Taco de Baseball");
- SendClientMessage(playerid, Amarelo, "6 - Pá | 7 - Taco de Sinuca | 8 - Katana | 9 - Serra Elétrica | 10 - Pinto de Borracha");
- SendClientMessage(playerid, Amarelo, "11 - Pinto roxo | 12 - Vibrador | 13 - Vibrador de Prata | 14 - Flor | 15 - Bengala");
- SendClientMessage(playerid, Amarelo, "16 - Granada | 17 - Bomba de Gás | 18 - Molotov | 22 - Pistola 9mm | 23 - Silenciada");
- SendClientMessage(playerid, Amarelo, "24 - Eagle | 25 - Shotgun | 26 - Sawoff | 27 - Combat Shotgun | 28 - Micro SMG");
- SendClientMessage(playerid, Amarelo, "29 - MP5 | 30 - AK47 | 31 - M4 | 32 - Tec 9 | 33 - Country Rifle | 34 - Sniper Rifle");
- SendClientMessage(playerid, Amarelo, "35 - Bazooca RPG | 36 - Bazooca | 37 - Lança Chamas | 38 - Minugun | 39 - C4");
- SendClientMessage(playerid, Amarelo, "40 - Detonador | 41 - Spray | 42 - Extintor | 43 - Visão Noturna | 44 - Visão de Calor");
- SendClientMessage(playerid, Amarelo, "46 - Paraquedas");
- return 1;
- }
- CMD:desarmar(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "d", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /desarmar [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- ResetPlayerWeapons(ID);
- //
- format(Str, sizeof(Str), "Você desarmou: %s", pNomeOriginal[ID]);
- SendClientMessage(ID, CorSucesso, Str);
- //
- format(Str, 106, "Você foi desarmado pelo administrador %s", pNomeOriginal[playerid]);
- SendClientMessage(ID, CorSucesso, Str);
- //
- format(Str, 106, "AdmCmd: %s desarmou %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
- Log("pAdmin/Logs/Desarmar.ini", Str);
- return 1;
- }
- CMD:respawnvehs(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- if(GetVehicleDriver(i))
- {
- if(FoiCriado[i] == true) DestroyVehicle(i);
- else SetVehicleToRespawn(i);
- }
- }
- format(Str, sizeof(Str), "O administrador %s deu Respawn em todos os veículos.", pNomeOriginal[playerid]);
- SendClientMessageToAll(CorSucesso, Str);
- //
- Log("pAdmin/Logs/RespawnVehs.ini", Str);
- return 1;
- }
- CMD:respawnveh(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /respawnveh [ID DO CARRO]");
- {
- if(GetVehicleDriver(ID))
- {
- if(FoiCriado[ID] == true) DestroyVehicle(ID), SendClientMessage(playerid, CorSucesso, "Este Veículo havia sido criado por um Administrador, portanto, foi destruído.");
- else SetVehicleToRespawn(Numero), SendClientMessage(playerid, CorSucesso, "Você Respawnou o Veículo.");
- }
- else SendClientMessage(playerid, CorErro, "Este veículo está tripulado, portanto, você não pode respawna-lo !");
- }
- format(Str, 256, "%s Respawnou o veículo %i (Modelo: %s)", pNomeOriginal[playerid], Numero, GetVehicleModel(Numero));
- //
- Log("pAdmin/Logs/RespawnVeh.ini", Str);
- return 1;
- }
- CMD:explodir(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /explodir [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
- //
- GetPlayerPos(ID, Pos[0], Pos[1], Pos[2]);
- CreateExplosion(Pos[0], Pos[1], Pos[2], 1, 5);
- //
- format(Str, sizeof(Str), "Você colocou fogo em %s.", pNomeOriginal[ID]);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- format(Str, 106, "AdmCmd: %s explodiu %s", pNomeOriginal[ID], pNomeOriginal[playerid]);
- Log("pAdmin/Logs/Explodir.ini", Str);
- return 1;
- }
- CMD:banir(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /banir [ID] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
- BanirPlayer(ID, playerid, Motivo);
- return 1;
- }
- CMD:tempban(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 1 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- new Dias;
- if(sscanf(params, "iis[56]", ID, Dias, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /tempban [ID] [TEMPO] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
- if(Dias == 0) return SendClientMessage(playerid, CorErro, "Você não pode banir alguém por 0 dias.. USE: /banir para banimentos permanentes.");
- if(Dias >= 360) return SendClientMessage(playerid, CorErro, "Você só pode banir alguém por no máximo 360 dias.");
- //
- new Data[24], Dia, Mes, Ano, Hora, Minuto;
- gettime(Hora, Minuto);
- getdate(Ano, Mes, Dia);
- format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
- format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", pNomeOriginal[ID]);
- DOF2_CreateFile(File);
- DOF2_SetString(File, "Administrador", pNomeOriginal[playerid]);
- DOF2_SetString(File, "Motivo", Motivo);
- DOF2_SetString(File, "Data", Data);
- Dia += Dias;
- if(Mes == 1 || Mes == 3 || Mes == 5 || Mes == 7 || Mes == 8 || Mes == 10 || Mes == 12)
- {
- if(Dia > 31)
- {
- Dia -= 31;
- Mes++;
- if(Mes > 12) Mes = 1;
- }
- }
- if(Mes == 4 || Mes == 6 || Mes == 9 || Mes == 11)
- {
- if(Dia > 30)
- {
- Dia -= 30;
- Mes++;
- }
- }
- if(Mes == 2)
- {
- if(Dia > 28)
- {
- Dia-=28;
- Mes++;
- }
- }
- format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
- DOF2_SetString(File, "Desban", Data);
- DOF2_SetInt(File, "DDesban", gettime() + 60 * 60 * 24 * Dias);
- DOF2_SaveFile();
- format(Str, sizeof(Str), "AdmCmd: O Player %s foi banido por %i dias pelo administrador %s. Motivo: %s", pNomeOriginal[ID], Dias, pNomeOriginal[playerid], Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- Kick(ID);
- return 1;
- }
- CMD:agendarban(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- new Nome[24], tempo;
- if(sscanf(params, "s[24]is[56]", Nome, tempo, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /agendarban [CONTA] [TEMPO EM DIAS (999 = FOREVER)] [MOTIVO]");
- format(File, sizeof(File), "pAdmin/Contas/%s.ini", Nome);
- if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Está conta não existe.");
- format(Str, sizeof(Str), "Agendado - %s", Motivo);
- AgendarBan(Nome, playerid, Str, tempo);
- format(Str, sizeof(Str), "AdmCmd: O Administrador %s agendou %s para ser banido. Motivo: %s", pNomeOriginal[playerid], Nome, Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- Log("pAdmin/Logs/AgendarBan.ini", Str);
- SendClientMessage(playerid, Amarelo, "DICA: Para cancelar um agendamento peça para um Master usar o /desbanir.");
- return 1;
- }
- CMD:agendarcadeia(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- new Nome[24];
- if(sscanf(params, "s[24]is[56]", Nome, ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /agendarcadeia [CONTA] [TEMPO EM MINUTOS] [MOTIVO]");
- new ID1 = GetPlayerID(Nome);
- if(IsPlayerConnected(ID1)) return SendClientMessage(playerid, CorErro, "Este jogador está Online, use /cadeia.");
- format(File, sizeof(File), "pAdmin/Contas/%s.ini", Nome);
- if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Está conta não existe.");
- format(Str, sizeof(Str), "AdmCmd: O Administrador %s agendou %s para %i minutos de cadeia. Motivo: %s", pNomeOriginal[playerid], Nome, ID, Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- AgendarCadeia(Nome, ID, playerid, Motivo);
- if(ID > 0) SendClientMessage(playerid, Amarelo, "DICA: Para cancelar um agendamento de cadeia use valores negativos no Tempo.");
- return 1;
- }
- CMD:ircarro(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /ircarro [CARRO ID]");
- if(ID == INVALID_VEHICLE_ID) return SendClientMessage(playerid, CorErro, "ID InválidO");
- GetVehiclePos(ID, Pos[0], Pos[1], Pos[2]);
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- return 1;
- }
- /* Comandos para administrador Level 2 */
- CMD:aviso(playerid, params[]) // /cadeia - /ban - /aviso
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /aviso [ID] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
- //
- PlayerInfo[ID][pAvisos]++;
- if(PlayerInfo[playerid][pAvisos] != 3)
- {
- format(Str, sizeof(Str), "AdmCmd: O Player %s recebeu um aviso do administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- Log("pAdmin/Logs/Aviso.ini", Str);
- Kick(ID);
- }
- else
- {
- format(Str, sizeof(Str), "AdmCmd: O Player %s recebeu um aviso do administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- Log("pAdmin/Logs/Aviso.ini", Str);
- BanirPlayer(ID, playerid, "Ultrapassou o limite de avisos");
- }
- return 1;
- }
- CMD:banirip(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /banirip [ID] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErro, "O jogador não está conectado.");
- BanirIP(ID, playerid, Motivo);
- return 1;
- }
- CMD:jogar(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Somente administradores level 2+ podem usar este comando.");
- if(pJogando[playerid] == false)
- {
- pJogando[playerid] = true;
- SendClientMessage(playerid, CorSucesso, "Você está jogando. Agora você é um Player Comum. Para voltar a administração use /jogar.");
- }
- else
- {
- pJogando[playerid] = false;
- SendClientMessage(playerid, CorSucesso, "Você está trabalhando. Agora você é um administrador. Para voltar a jogar use /jogar.");
- }
- return 1;
- }
- CMD:calar(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 2 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /calar [ID] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- PlayerInfo[ID][pCalado] = true;
- //
- format(Str, sizeof(Str), "AdmCmd: O administrador %s calou %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[ID], Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- //
- Log("pAdmin/Logs/Calar.ini", Str);
- return 1;
- }
- CMD:descalar(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 2 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /descalar [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- PlayerInfo[ID][pCalado] = false;
- //
- format(Str, sizeof(Str), "AdmCmd: O administrador %s habilitou o chat de %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
- SendClientMessageToAll(VermelhoEscuro, Str);
- //
- Log("pAdmin/Logs/Descalar.ini", Str);
- return 1;
- }
- CMD:limparchat(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 2 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- for(new i = 0; i < 300; i++)
- {
- SendClientMessageToAll(-1, " ");
- }
- format(Str, 256, "AdmCmd: {00FF00}Chat Limpo com Sucesso por: {9400D3}%s", pNomeOriginal[playerid]);
- SendClientMessageToAll(VermelhoEscuro, Str);
- //
- format(Str, 256, "AdmCmd: O administrador %s limpou o chat", pNomeOriginal[playerid]);
- Log("pAdmin/Logs/LimparChat.ini", Str);
- return 1;
- }
- /* Comandos para administrador Level 3 */
- CMD:ejetar(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 3 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /ejetar [ID]");
- RemovePlayerFromVehicle(ID);
- return 1;
- }
- CMD:destroyveh(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 3 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /destroyveh [ID DO CARRO]");
- {
- if(GetVehicleDriver(ID))
- {
- DestroyVehicle(ID);
- SendClientMessage(playerid, CorSucesso, "Você destruiu o Veículo.");
- }
- else
- {
- SendClientMessage(playerid, CorErro, "Este veículo está tripulado, portanto, você não pode destruí-lo ! Use /ejetar [ID]");
- }
- }
- return 1;
- }
- CMD:congelar(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 3 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /congelar [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- TogglePlayerControllable(ID, false);
- PlayerInfo[playerid][pCongelado] = true;
- SetPlayerHealth(ID, 99999);
- SendClientMessage(playerid, CorSucesso, "Você congelou o Player");
- //
- format(Str, sizeof(Str), "O administrador %s congelou: %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
- Log("pAdmin/Logs/Congelar.ini", Str);
- return 1;
- }
- CMD:descongelar(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 3 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /descongelar [ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- SetPlayerHealth(ID, 100);
- TogglePlayerControllable(ID, true);
- PlayerInfo[playerid][pCongelado] = false;
- SendClientMessage(playerid, CorSucesso, "Você descongelou o Player.");
- //
- format(Str, sizeof(Str), "O administrador %s descongelou %s", pNomeOriginal[playerid], pNomeOriginal[ID]);
- Log("pAdmin/Logs/Descongelar.ini", Str);
- return 1;
- }
- /* Comandos para administrador Level 4 */
- CMD:setarmundo(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 4 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "id", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarmundo [ID] [WORLD ID]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- SetPlayerVirtualWorld(ID, Numero);
- //
- format(Str, sizeof(Str), "Você setou o mundo virtual de %s para %d", ID, Numero);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- format(Str, sizeof(Str), "O administrador %s setou seu mundo virtual para %d", pNomeOriginal[playerid], Numero);
- SendClientMessage(ID, CorSucesso, Str);
- //
- format(Str, 106, "AdmCmd: %s setou o Virtual World de %s para %i", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
- Log("pAdmin/Logs/SetarMundo.ini", Str);
- return 1;
- }
- CMD:aa4(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 4 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- //
- SendClientMessage(playerid, CinzaEscuro, "x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
- SendClientMessage(playerid, Amarelo, "Administrador Level 4:");
- SendClientMessage(playerid, CinzaClaro, "/setarmundo - /aa4");
- SendClientMessage(playerid, Amarelo, "Administrador Level 5 (MASTER):");
- SendClientMessage(playerid, CinzaClaro, "/chat - /desbanir - /desbanirip - /disfarce - /congelartodos");
- SendClientMessage(playerid, CinzaClaro, "/descongelartodos - /dardinheiro - /setardinheiro - /setarscore");
- SendClientMessage(playerid, CinzaClaro, "/clima - /vidatodos - /coletetodos - /armatodos - /esconder");
- SendClientMessage(playerid, CinzaClaro, "/fakekick - /fakeban");
- SendClientMessage(playerid, Amarelo, "Administrador Level 6 (MÁXIMO):");
- SendClientMessage(playerid, CinzaClaro, "/daradmin - /tiraradmin");
- SendClientMessage(playerid, Amarelo, "Administrador Level 7 (DONO):");
- SendClientMessage(playerid, CinzaClaro, "/gmx - /senhaserver -/antiafk");
- SendClientMessage(playerid, CinzaEscuro, "x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-");
- //
- return 1;
- }
- /* MASTER */
- CMD:chat(playerid)
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 5 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(ChatLigado == true)
- {
- SendClientMessage(playerid, Amarelo, "Você desativou o Chat para todos os jogadores.");
- ChatLigado = false;
- format(Str, 256, "O Administrador %s desabilitou o Chat para todos os jogadores.", pNomeOriginal[playerid]);
- }
- else
- {
- SendClientMessage(playerid, Amarelo, "Você ativou o Chat para todos os jogadores.");
- ChatLigado = true;
- format(Str, 256, "O Administrador %s habilitou o Chat para todos os jogadores.", pNomeOriginal[playerid]);
- }
- SendClientMessageToAll(AzulRoyal, Str);
- return 1;
- }
- CMD:desbanir(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 5 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "s[24]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /desbanir [Conta - Nome_Sobrenome (COMPLETO)]");
- format(File, sizeof(File), "pAdmin/Contas/%s.ini", Motivo);
- if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Esta conta não foi encontrada em nosso banco de dados.");
- format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", Motivo);
- if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Esta conta não está banida.");
- new File1[48];
- format(File1, 48, "pAdmin/Backups/Banidos/%s.ini", Motivo);
- DOF2_CopyFile(File, File1);
- DOF2_RemoveFile(File);
- //
- format(Str, sizeof(Str), "AdmCmd: O Player %s foi desbanido pelo administrador %s.", Motivo, pNomeOriginal[playerid]);
- SendClientMessageToAll(VermelhoEscuro, Str);
- Log("pAdmin/Logs/Desbanir.ini", Str);
- return 1;
- }
- CMD:desbanirip(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 5 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "s[24]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "ERRO: Use /desbanirip [IP]");
- format(File, sizeof(File), "pAdmin/Banidos/IPs/%s.ini", Motivo);
- if(!DOF2_FileExists(File)) return SendClientMessage(playerid, CorErro, "Este IP não está banido.");
- new File1[48];
- format(File1, 48, "pAdmin/Backups/IPs Banidos/%s.ini", Motivo);
- DOF2_CopyFile(File, File1);
- DOF2_RemoveFile(File);
- //
- SendClientMessage(playerid, Amarelo, "O IP foi desbanido com sucesso.");
- format(Str, sizeof(Str), "AdmCmd: O IP %s foi desbanido pelo administrador %s.", Motivo);
- Log("pAdmin/Logs/DesbanirIP.ini", Str);
- return 1;
- }
- CMD:disfarce(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador level 5 para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- GetPlayerName(playerid, Motivo, 56);
- if(strcmp(pNomeOriginal[playerid], Motivo))
- {
- AparecendoNoAdmins[playerid] = true;
- SetPlayerName(playerid, pNomeOriginal[playerid]);
- SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
- SetPlayerColor(playerid, 0xDDA0DDFF);
- SendClientMessage(playerid, CorSucesso, "Você saiu do disfarce com sucesso");
- //
- format(Str, 106, "AdmCmd: %s saiu do disfarce", pNomeOriginal[playerid]);
- Log("pAdmin/Logs/Disfarce.ini", Str);
- }
- else
- {
- AparecendoNoAdmins[playerid] = false;
- if(sscanf(params, "s[56]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /disfarce [NOME]");
- SetPlayerName(playerid, Motivo);
- SetPlayerColor(playerid, 0xD3D3D3FF);
- SendClientMessage(playerid, CorSucesso, "Você se disfarçou com sucesso");
- format(Str, 106, "AdmCmd: %s se disfarçou com o nome de %s", pNomeOriginal[playerid], Motivo);
- Log("pAdmin/Logs/Disfarce.ini", Str);
- }
- return 1;
- }
- CMD:congelartodos(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- TogglePlayerControllable(i, false);
- PlayerInfo[playerid][pCongelado] = true;
- }
- format(Str, sizeof(Str), "O administrador %s congelou todos os Jogadores", pNomeOriginal[playerid]);
- SendClientMessageToAll(CorSucesso, Str);
- //
- Log("pAdmin/Logs/CongelarTodos.ini", Str);
- return 1;
- }
- CMD:descongelartodos(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- TogglePlayerControllable(i, true);
- PlayerInfo[playerid][pCongelado] = false;
- }
- format(Str, sizeof(Str), "O administrador %s descongelou todos os Jogadores", pNomeOriginal[playerid]);
- SendClientMessageToAll(CorSucesso, Str);
- //
- Log("pAdmin/Logs/DescongelarTodos.ini", Str);
- return 1;
- }
- CMD:dardinheiro(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(Numero < 0 || Numero > 10000000) return SendClientMessage(playerid, CorErro, "O valor deve estar entre 0 e 10.000.000 (10kk)");
- if(sscanf(params, "dd", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /dardinheiro [ID] [QUANTIA]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- GivePlayerMoney(ID, Numero);
- format(Str, 256, "Você deu a %s %d de dinheiro.", pNomeOriginal[ID], Numero);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- format(Str, sizeof(Str), "O administrador %s lhe deu %d de dinheiro.", pNomeOriginal[playerid], Numero);
- SendClientMessage(ID, CorSucesso, Str);
- //
- format(Str, 256, "AdmCmd: O administrador %s deu %d de dinheiro para %s", pNomeOriginal[playerid], Numero, pNomeOriginal[ID]);
- Log("pAdmin/Logs/DarDinheiro.ini", Str);
- return 1;
- }
- CMD:setardinheiro(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- new Tanto;
- if(sscanf(params, "dd", ID, Tanto)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setardinheiro [ID] [QUANTIA]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- SetPlayerMoney(ID, Tanto);
- //
- format(Str, 256, "Você setou o dinheiro de %s para: %d", pNomeOriginal[ID], Tanto);
- SendClientMessage(playerid, CorSucesso, Str);
- format(Str, sizeof(Str), "O administrador %s setou seu dinheiro para: %d", pNomeOriginal[playerid], Tanto);
- SendClientMessage(ID, CorSucesso, Str);
- //
- format(Str, 256, "AdmCmd: O administrador %s setou o dinheiro de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Tanto);
- Log("pAdmin/Logs/SetarDinheiro.ini", Str);
- return 1;
- }
- CMD:setarscore(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "dd", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /setarscore [ID] [SCORE]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- SetPlayerScore(ID, Numero);
- //
- format(Str, sizeof(Str), "Você setou o nível de %s para: %d", pNomeOriginal[ID], Numero);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- format(Str, sizeof(Str), "O administrador %s setou seu nível para: %d", pNomeOriginal[playerid], Numero);
- SendClientMessage(playerid, CorSucesso, Str);
- //
- format(Str, 256, "AdmCmd: O administrador %s setou o level de %s para %d", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
- Log("pAdmin/Logs/SetarScore.ini", Str);
- return 1;
- }
- CMD:clima(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "i", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /clima [ID DO CLIMA]");
- if(ID < 1 || ID > 19) return SendClientMessage(playerid, CorErro, "Use somente IDs entre 1 em 19.");
- //
- SetWeather(ID);
- format(Str, 256, "AdmCmd: O administrador %s alterou o Clima para o ID %d.", pNomeOriginal[playerid], ID);
- SendClientMessageToAll(CorSucesso, Str);
- //
- Log("pAdmin/Logs/Clima.ini", Str);
- return 1;
- }
- CMD:vidatodos(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- SetPlayerHealth(i, 100);
- }
- format(Str, 256, "AdmCmd: O administrador %s encheu a vida de todos os jogadores conectados.", pNomeOriginal[playerid]);
- SendClientMessageToAll(CorSucesso, Str);
- //
- Log("pAdmin/Logs/VidaTodos.ini", Str);
- return 1;
- }
- CMD:coletetodos(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- SetPlayerArmour(i, 100);
- }
- format(Str, 256, "AdmCmd: O administrador %s encheu o colete de todos os jogadores conectados.", pNomeOriginal[playerid]);
- SendClientMessageToAll(CorSucesso, Str);
- //
- Log("pAdmin/Logs/ColeteTodos.ini", Str);
- return 1;
- }
- CMD:armatodos(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "ii", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /armatodos [ARMA ID] [MUNIÇAO] | Para ver os IDs das armas, use: /idarmas");
- if(ID < 1 || ID == 19 || ID == 20 || ID == 21 || ID > 46) return SendClientMessage(playerid, CorErro, "ID da Arma Invalido, use de 1 a 46");
- for(new i=0; i <MAX_PLAYERS; i++)
- {
- GivePlayerWeapon(i, ID, Numero);
- }
- switch(ID)
- {
- case 1: Motivo = "Soco Inglês";
- case 2: Motivo = "Taco de Golf";
- case 3: Motivo = "Cacetete";
- case 4: Motivo = "Faca";
- case 5: Motivo = "Taco de Baseball";
- case 6: Motivo = "Pá";
- case 7: Motivo = "Taco de Sinuca";
- case 8: Motivo = "Kitana";
- case 9: Motivo = "Serra elétrica";
- case 10: Motivo = "Pinto de Borracha";
- case 11: Motivo = "Pinto roxo";
- case 12: Motivo = "Vibrador";
- case 13: Motivo = "Vibrador de Prata";
- case 14: Motivo = "Flor";
- case 15: Motivo = "Bengala";
- case 16: Motivo = "Granada";
- case 17: Motivo = "Bomba de gás";
- case 18: Motivo = "Molotov";
- case 22: Motivo = "Pistola 9mm";
- case 23: Motivo = "Pistola com silenciador";
- case 24: Motivo = "Desert Eagle";
- case 25: Motivo = "ShotGun";
- case 26: Motivo = "Sawnoff Shotgun";
- case 27: Motivo = "Combat Shotgun";
- case 28: Motivo = "Micro SMG";
- case 29: Motivo = "MP5";
- case 30: Motivo = "AK47";
- case 31: Motivo = "M4";
- case 32: Motivo = "Tec 9";
- case 33: Motivo = "Country Rifle";
- case 34: Motivo = "Sniper Rifle";
- case 35: Motivo = "Bazooca RPG";
- case 36: Motivo = "Bazooca Normal";
- case 37: Motivo = "Lança Chamas";
- case 38: Motivo = "Mini Gun";
- case 39: Motivo = "C4";
- case 40: Motivo = "Detonador";
- case 41: Motivo = "Spray";
- case 42: Motivo = "Extintor";
- case 43: Motivo = "Oculos de visão noturna";
- case 45: Motivo = "Oculos de visão de calor";
- case 46: Motivo = "Paraquedas";
- }
- format(Str, 256, "AdmCmd: O administrador %s deu uma %s com %d balas para todos os jogadores conectados.", pNomeOriginal[playerid], Motivo, Numero);
- SendClientMessageToAll(CorSucesso, Str);
- //
- Log("pAdmin/Logs/ArmaTodos.ini", Str);
- return 1;
- }
- CMD:esconder(playerid)
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- //
- new bool:Trocou = false;
- if(AparecendoNoAdmins[playerid] == true)
- {
- Trocou = true;
- AparecendoNoAdmins[playerid] = false;
- SendClientMessage(playerid, CorSucesso, "Você está escondido e não aparecerá no /admins");
- }
- if(AparecendoNoAdmins[playerid] == false && Trocou == false)
- {
- AparecendoNoAdmins[playerid] = true;
- SendClientMessage(playerid, CorSucesso, "Você não está mais escondido e aparecerá no /admins");
- }
- return 1;
- }
- CMD:fakekick(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "is[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /fakekick [ID] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- format(Str, 256, "AdmCmd: O Player %s foi kickado pelo administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- //
- format(Str, 256, "AdmCmd: O administrador %s fingiu ter kickado %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[playerid], Motivo);
- Log("pAdmin/Logs/FakeKick.ini", Str);
- return 1;
- }
- CMD:fakeban(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MASTER para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "us[56]", ID, Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /fakeban [ID] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- format(Str, sizeof(Str), "AdmCmd: O Player %s foi banido pelo administrador %s. Motivo: %s", pNomeOriginal[ID], pNomeOriginal[playerid], Motivo);
- SendClientMessageToAll(VermelhoEscuro, Str);
- //
- format(Str, 256, "AdmCmd: O administrador %s fingiu ter banido %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[ID], Motivo);
- Log("pAdmin/Logs/FakeBan.ini", Str);
- return 1;
- }
- /* Administrador Level 6 */
- CMD:daradmin(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MÁXIMO para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "ii", ID, Numero)) return SendClientMessage(playerid, CorErroNeutro, "USE: /daradmin [ID] [LEVEL]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- if(Numero > 6 || Numero == 0) return SendClientMessage(playerid, Vermelho, "ERRO: O Level deve esstar entre 1 e 6 !");
- format(Str, 256, "Você definiu o level de administração de %s para %i.", pNomeOriginal[ID], Numero);
- SendClientMessage(playerid, Azul, Str);
- //
- format(Str, 256, "Você foi promovido a Level %i de administração. Você foi promovido por %s.", Numero, pNomeOriginal[playerid]);
- SendClientMessage(ID, Azul, Str);
- //
- format(Str, sizeof(Str), "AdmCmd: O administrador %s definiu o nível de administração de %s para %i.", pNomeOriginal[playerid], pNomeOriginal[ID], Numero);
- PlayerInfo[ID][pAdmin] = Numero;
- //
- Log("pAdmin/Logs/DarAdmin.ini", Str);
- return 1;
- }
- CMD:tiraradmin(playerid, params[])
- {
- new MotivoM[256];
- if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador MÁXIMO para usar este comando");
- if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Você não está trabalhando!");
- if(sscanf(params, "ds[256]", ID, MotivoM)) return SendClientMessage(playerid, CorErroNeutro, "USE: /tiraradmin [ID] [MOTIVO]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, CorErroNeutro, "O jogador não está conectado");
- //
- format(Str, 256, "Você retirou %s da administração", pNomeOriginal[ID]);
- SendClientMessage(playerid, Azul, Str);
- //
- format(Str, 256, "Você foi retirado da administração por %s. Motivo: %s", pNomeOriginal[playerid], MotivoM);
- SendClientMessage(ID, Azul, Str);
- //
- format(Str, sizeof(Str), "AdmCmd: O administrador %s definiu o nível de administração de %s para 0. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[ID], MotivoM);
- PlayerInfo[ID][pAdmin] = 0;
- //
- Log("pAdmin/Logs/TirarAdmin.ini", Str);
- return 1;
- }
- /* Administrador Dono */
- #if UsarPedAnims == 1
- CMD:antiafk(playerid)
- {
- if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador DONO para usar este comando");
- if(AntiAFK_Ativado)
- {
- AntiAFK_Ativado = false;
- SendClientMessage(playerid, CorSucesso, "Anti-AFK desativado.");
- }
- else
- {
- AntiAFK_Ativado = true;
- SendClientMessage(playerid, CorSucesso, "Anti-AFK ativado.");
- }
- return 1;
- }
- #endif
- CMD:gmx(playerid)
- {
- if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador DONO para usar este comando");
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && pLogado[i] == true) SalvarDados(i);
- format(Str, 256, "Atenção: Um GMX foi executado por %s. O Servidor voltará em poucos segundos.", pNomeOriginal[playerid]);
- SendClientMessage(playerid, Amarelo, Str);
- }
- SendRconCommand("gmx");
- return 1;
- }
- CMD:senhaserver(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, CorErro, "Você precisa ser uma Administrador DONO para usar este comando");
- if(sscanf(params, "s[56]", Motivo)) return SendClientMessage(playerid, CorErroNeutro, "USE: /senhaserver [SENHA] | 0 = SEM SENHA");
- SendRconCommand(Motivo);
- SendClientMessageToAll(Amarelo, "O Servidor foi trancado.");
- return 1;
- }
- /* STOCKs */
- stock GetPlayerID(Nome[])
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(!strcmp(pNomeOriginal[i], Nome, true, 24)) return i;
- }
- }
- return -1;
- }
- stock BanirPlayer(playerid, administrador, Motivo1[])
- {
- new Data[24], Dia, Mes, Ano, Hora, Minuto;
- gettime(Hora, Minuto);
- getdate(Ano, Mes, Dia);
- format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
- format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", pNomeOriginal[playerid]);
- DOF2_CreateFile(File);
- DOF2_SetString(File, "Administrador", pNomeOriginal[administrador]);
- DOF2_SetString(File, "Motivo", Motivo1);
- DOF2_SetString(File, "Data", Data);
- DOF2_SetString(File, "Desban", "Nunca");
- DOF2_SetInt(File, "DDesban", gettime() + 60 * 60 * 24 * 999);
- DOF2_SaveFile();
- format(Str, sizeof(Str), "AdmCmd: O Player %s foi banido pelo administrador %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[administrador], Motivo1);
- SendClientMessageToAll(VermelhoEscuro, Str);
- Log("pAdmin/Logs/Banir.ini", Str);
- Kick(playerid);
- return 1;
- }
- stock AgendarBan(playerid[], administrador, Motivo1[], Dias)
- {
- new Data[24], Dia, Mes, Ano, Hora, Minuto;
- gettime(Hora, Minuto);
- getdate(Ano, Mes, Dia);
- format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
- format(File, sizeof(File), "pAdmin/Banidos/Contas/%s.ini", playerid);
- DOF2_CreateFile(File);
- DOF2_SetString(File, "Administrador", pNomeOriginal[administrador]);
- DOF2_SetString(File, "Motivo", Motivo1);
- DOF2_SetString(File, "Data", Data);
- if(Dias == 999)
- {
- DOF2_SetString(File, "Desban", "Nunca");
- DOF2_SetInt(File, "DDesban", gettime() + 60 * 60 * 24 * 999); // 999 DIAS
- }
- else
- {
- getdate(Ano, Mes, Dia);
- Dia += Dias;
- if(Mes == 1 || Mes == 3 || Mes == 5 || Mes == 7 || Mes == 8 || Mes == 10 || Mes == 12)
- {
- if(Dia > 31)
- {
- Dia -= 31;
- Mes++;
- if(Mes > 12) Mes = 1;
- }
- }
- if(Mes == 4 || Mes == 6 || Mes == 9 || Mes == 11)
- {
- if(Dia > 30)
- {
- Dia -= 30;
- Mes++;
- }
- }
- if(Mes == 2)
- {
- if(Dia > 28)
- {
- Dia-=28;
- Mes++;
- }
- }
- gettime(Hora, Minuto);
- format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
- //
- DOF2_SetString(File, "Desban", Data);
- DOF2_SetInt(File, "DDesban", gettime() + 60 * 60 * 24 * Dias);
- }
- DOF2_SaveFile();
- return 1;
- }
- stock AgendarCadeia(playerid[], tempo, administrador, Motivo1[])
- {
- if(tempo < 0)
- {
- format(File, 56, "pAdmin/Contas/%s.ini", playerid);
- new TempoAtual = DOF2_GetInt(File, "pCadeia");
- if(tempo * -1 >= TempoAtual / 60)
- {
- DOF2_SetInt(File, "pCadeia", 0);
- DOF2_SaveFile();
- format(File, 56, "pAdmin/Agendados/%s.ini", playerid);
- if(DOF2_FileExists(File)) DOF2_RemoveFile(File);
- return 0;
- }
- else
- {
- new tempo1 = tempo * -1 * 60;
- TempoAtual -= tempo1;
- DOF2_SetInt(File, "pCadeia", TempoAtual);
- DOF2_SaveFile();
- format(File, 56, "pAdmin/Agendados/%s.ini", playerid);
- if(DOF2_FileExists(File)) DOF2_SetInt(File, "Tempo", DOF2_GetInt(File, "Tempo") - tempo * -1), DOF2_SaveFile();
- return 0;
- }
- }
- if(tempo > 0)
- {
- format(File, 56, "pAdmin/Contas/%s.ini", playerid);
- if(DOF2_GetInt(File, "pCadeia") > 0)
- {
- new Tempo9;
- Tempo9 = tempo * 60;
- DOF2_SetInt(File, "pCadeia", DOF2_GetInt(File, "pCadeia") + Tempo9);
- DOF2_SaveFile();
- }
- else
- {
- DOF2_SetInt(File, "pCadeia", tempo * 60);
- DOF2_SaveFile();
- }
- format(File, 56, "pAdmin/Agendados/%s.ini", playerid);
- if(!DOF2_FileExists(File))
- {
- DOF2_CreateFile(File);
- DOF2_SetInt(File, "Tempo", tempo);
- DOF2_SetString(File, "Administrador", pNomeOriginal[administrador]);
- DOF2_SetString(File, "Motivo", Motivo1);
- DOF2_SaveFile();
- }
- else
- {
- new ADM[24], Motivo2[56], Tempo1;
- format(ADM, 24, DOF2_GetString(File, "Administrador"));
- format(Motivo2, 56, DOF2_GetString(File, "Motivo"));
- Tempo1 = DOF2_GetInt(File, "Tempo");
- format(Str, 256, "%s | %s", ADM, pNomeOriginal[administrador]);
- DOF2_SetString(File, "Administrador", Str);
- format(Str, 256, "%s | %s", Motivo2, Motivo1);
- DOF2_SetString(File, "Motivo", Str);
- DOF2_SetInt(File, "Tempo", tempo + Tempo1);
- DOF2_SaveFile();
- }
- }
- return 1;
- }
- stock BanirIP(playerid, administrador, Motivo1[])
- {
- new Data[24], Dia, Mes, Ano, Hora, Minuto;
- gettime(Hora, Minuto);
- getdate(Ano, Mes, Dia);
- format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
- format(File, sizeof(File), "pAdmin/Banidos/IPs/%s.ini", GetPlayerIpEx(playerid));
- DOF2_CreateFile(File);
- DOF2_SetString(File, "Administrador", pNomeOriginal[administrador]);
- DOF2_SetString(File, "Motivo", Motivo1);
- DOF2_SetString(File, "Data", Data);
- DOF2_SaveFile();
- format(Str, sizeof(Str), "AdmCmd: O Player %s foi banido pelo administrador %s. Motivo: %s", pNomeOriginal[playerid], pNomeOriginal[administrador], Motivo1);
- SendClientMessageToAll(VermelhoEscuro, Str);
- Log("pAdmin/Logs/BanirIP.ini", Str);
- Kick(playerid);
- return 1;
- }
- stock CriarDados(playerid)
- {
- format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
- if(!DOF2_FileExists(File)) DOF2_CreateFile(File);
- DOF2_SetString(File, "pSenha", PlayerInfo[playerid][pSenha]);
- DOF2_SetInt(File, "pLevel", LEVELINICIAL);
- DOF2_SetInt(File, "pSkin", SKININICIAL);
- DOF2_SetInt(File, "pDinheiro", DINHEIROINICIAL);
- DOF2_SetInt(File, "pSegundosJogados", 0);
- DOF2_SetInt(File, "pAvisos", 0);
- DOF2_SetInt(File, "pCadeia", 0);
- DOF2_SetInt(File, "pAdmin", 0);
- DOF2_SetString(File, "pLastLogin", "-");
- DOF2_SetInt(File, "pInterior", 0);
- DOF2_SetFloat(File, "pPosX", SPAWNX);
- DOF2_SetFloat(File, "pPosY", SPAWNY);
- DOF2_SetFloat(File, "pPosZ", SPAWNZ);
- DOF2_SetFloat(File, "pPosA", SPAWNA);
- DOF2_SetFloat(File, "pCamX", 0.0);
- DOF2_SetFloat(File, "pCamY", 0.0);
- DOF2_SetFloat(File, "pCamZ", 0.0);
- DOF2_SetBool(File, "pCongelado", false);
- DOF2_SetBool(File, "pCalado", false);
- DOF2_SaveFile();
- format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo ao servidor %s.\nPara validar o seu Login digite sua senha abaixo.", pNomeOriginal[playerid]);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{E9967A}Seja bem vindo ao servidor...", Str, "Validar", "Cancelar");
- return 1;
- }
- stock CarregarDados(playerid)
- {
- format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
- if(!DOF2_FileExists(File)) return SendClientMessage(playerid, Vermelho, "Os dados não puderam ser carregados, tente novamente."), Kick(playerid);
- //
- format(PlayerInfo[playerid][pSenha], 24, DOF2_GetString(File, "pSenha"));
- format(PlayerInfo[playerid][pLastLogin], 24, DOF2_GetString(File, "pLastLogin"));
- PlayerInfo[playerid][pLevel] = DOF2_GetInt(File, "pLevel");
- PlayerInfo[playerid][pSkin] = DOF2_GetInt(File, "pSkin");
- PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(File, "pDinheiro");
- PlayerInfo[playerid][pSegundosJogados] = DOF2_GetInt(File, "pSegundosJogados");
- PlayerInfo[playerid][pAvisos] = DOF2_GetInt(File, "pAvisos");
- PlayerInfo[playerid][pCadeia] = DOF2_GetInt(File, "pCadeia");
- PlayerInfo[playerid][pAdmin] = DOF2_GetInt(File, "pAdmin");
- PlayerInfo[playerid][pInterior] = DOF2_GetInt(File, "pInterior");
- PlayerInfo[playerid][pPosX] = DOF2_GetFloat(File, "pPosX");
- PlayerInfo[playerid][pPosY] = DOF2_GetFloat(File, "pPosY");
- PlayerInfo[playerid][pPosZ] = DOF2_GetFloat(File, "pPosZ");
- PlayerInfo[playerid][pPosA] = DOF2_GetFloat(File, "pPosA");
- PlayerInfo[playerid][pCamX] = DOF2_GetFloat(File, "pCamX");
- PlayerInfo[playerid][pCamY] = DOF2_GetFloat(File, "pCamY");
- PlayerInfo[playerid][pCamZ] = DOF2_GetFloat(File, "pCamZ");
- PlayerInfo[playerid][pCongelado] = DOF2_GetBool(File, "pCongelado");
- PlayerInfo[playerid][pCalado] = DOF2_GetBool(File, "pCalado");
- //
- if(FirstLogin[playerid] == false)
- {
- ShowPlayerDialog(playerid, DIALOG_POS, DIALOG_STYLE_MSGBOX, "{E9967A}Você gostaria de...", "{BEBEBE}Você gostaria de Spawnar na posição onde deslogou pela última vez ?", "SIM", "NÃO");
- format(Str, sizeof(Str), "{BEBEBE}Seja bem-vindo {FFFF00}%s{BEBEBE}. Seu último login foi em {FFFF00}%s{BEBEBE}.", pNomeOriginal[playerid], PlayerInfo[playerid][pLastLogin]);
- SendClientMessage(playerid, Branco, Str);
- }
- else
- {
- SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], SPAWNX, SPAWNY, SPAWNZ, SPAWNA, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- FirstLogin[playerid] = false;
- }
- pLogado[playerid] = true;
- if(PlayerInfo[playerid][pAdmin] > 0) pJogando[playerid] = false;
- return 1;
- }
- stock SalvarDados(playerid)
- {
- format(File, sizeof(File), "pAdmin/Contas/%s.ini", pNomeOriginal[playerid]);
- if(!DOF2_FileExists(File)) DOF2_CreateFile(File);
- //
- new Data[24], Dia, Mes, Ano, Hora, Minuto, Float:A, Float:X, Float:Y, Float:Z;
- GetPlayerCameraPos(playerid, X, Y, Z);
- gettime(Hora, Minuto);
- getdate(Ano, Mes, Dia);
- format(Data, 24, "%02d/%02d/%d - %02d:%02d", Dia, Mes, Ano, Hora, Minuto);
- //
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(playerid, A);
- DOF2_SetString(File, "pSenha", PlayerInfo[playerid][pSenha]);
- DOF2_SetInt(File, "pLevel", GetPlayerScore(playerid));
- DOF2_SetInt(File, "pSkin", GetPlayerSkin(playerid));
- DOF2_SetInt(File, "pDinheiro", GetPlayerMoney(playerid));
- DOF2_SetInt(File, "pSegundosJogados", PlayerInfo[playerid][pSegundosJogados]);
- DOF2_SetInt(File, "pAvisos", PlayerInfo[playerid][pAvisos]);
- DOF2_SetInt(File, "pCadeia", PlayerInfo[playerid][pCadeia]);
- DOF2_SetInt(File, "pAdmin", PlayerInfo[playerid][pAdmin]);
- DOF2_SetString(File, "pLastLogin", Data);
- DOF2_SetInt(File, "pInterior", GetPlayerInterior(playerid));
- DOF2_SetFloat(File, "pPosX", Pos[0]);
- DOF2_SetFloat(File, "pPosY", Pos[1]);
- DOF2_SetFloat(File, "pPosZ", Pos[2]);
- DOF2_SetFloat(File, "pPosA", A);
- DOF2_SetFloat(File, "pCamX", X);
- DOF2_SetFloat(File, "pCamY", Y);
- DOF2_SetFloat(File, "pCamZ", Z);
- DOF2_SetBool(File, "pCongelado", PlayerInfo[playerid][pCongelado]);
- DOF2_SetBool(File, "pCalado", PlayerInfo[playerid][pCalado]);
- DOF2_SaveFile();
- return 1;
- }
- stock GetPlayerIpEx(playerid)
- {
- new pIP[36];
- GetPlayerIp(playerid, pIP, 36);
- return pIP;
- }
- stock Log(Arquivo[], string[])
- {
- if(!DOF2_FileExists(Arquivo))
- {
- DOF2_CreateFile(Arquivo);
- }
- new dia, mes, ano, hora, minuto, segundo, Data[24];
- gettime(hora, minuto, segundo);
- getdate(ano, mes, dia);
- format(Data, 24, "%02d/%02d/%d - %02d:%02d:%02d", dia, mes, ano, hora, minuto, segundo);
- DOF2_SetString(Arquivo, Data, string);
- DOF2_SaveFile();
- }
- stock DeletarLog(const File1[])
- {
- if(!fexist(File1))
- {
- printf("Esse arquivo não existe, utilize Log(\"arquivo\"");
- return 0;
- }
- fremove(File1);
- return 1;
- }
- stock SendAdminMessage(Cor, Mensagem[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pAdmin] > 0)
- {
- SendClientMessage(i, Cor, Mensagem);
- }
- }
- return 1;
- }
- stock SetPlayerMoney(ID1, Quantia)
- {
- ResetPlayerMoney(ID1);
- GivePlayerMoney(ID1, Quantia);
- return 1;
- }
- stock GetVehicleDriver(vehicleid)
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2) return i;
- }
- return -1;
- }
- stock GetVehiclePassenger(vehicleid)
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 3) return i;
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment