Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- //OBS: PM's Podem ser banidos injustamente (Arrumo isso na versão 2.0)
- //dcmd
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- //Variaveis Player
- new Float:Vida_Player[MAX_PLAYERS];
- new Float:Colete_Player[MAX_PLAYERS];
- //defines...
- #define ArmasProibidas 5
- //#define PermitiAdm false //Vou fazer nao --'
- //Defines Tipo de Hack
- #define Hack_Vida 1
- #define Hack_Colete 2
- #define Hack_Arma_1 3
- #define Hack_Arma_2 4
- #define Limpo 5
- #define Interior 6
- //Id's Armas Proibidas
- new Armas_Proibidas[0][ArmasProibidas] = {
- {1,2,3,4,5}
- };
- public OnPlayerConnect(playerid)
- {
- Vida_Player[playerid] = 0.0;
- Colete_Player[playerid] = 0.0;
- return 0x01;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(slap,4,cmdtext);
- return 0x01;
- }
- dcmd_slap(playerid, params[])
- {
- new id, string[128];
- if(!strval(params)) return SendClientMessage(playerid, -1, "Digite corretamente: '/Slap ID'");
- if(!IsNumeric(params)) return SendClientMessage(playerid, -1, "Digite corretamente: '/Slap ID'");
- id = strval(params);
- if(IsPlayerConnected(id))
- {
- format(string, sizeof(string), "[Cheats] Iniciando os testes no Jogador: %s", ReturnPlayer(id));
- SendClientMessageToAll(-1, string);
- VerificarHack(id);
- }
- return 0x01;
- }
- VerificarHack(playerid)
- {
- if(GetPlayerInterior(playerid) > 0)
- {
- HackDetect(playerid, Interior);
- return 0x01;
- }
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerHealth(playerid, Vida_Player[playerid]);
- GetPlayerArmour(playerid, Colete_Player[playerid]);
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 100);
- SetPlayerPos(playerid, x, y, z+2);
- CreateExplosion(x, y, z+2, 0, 5);
- SetTimerEx("Verificar_1", 2000, true, "i", playerid);
- return 0x01;
- }
- forward Verificar_1(playerid);
- public Verificar_1(playerid)
- {
- new Float:vida, Float:colete;
- GetPlayerHealth(playerid, vida);
- GetPlayerArmour(playerid, colete);
- if(vida == Vida_Player[playerid])
- {
- HackDetect(playerid, Hack_Vida);
- return 0x01;
- }
- else if(colete == Colete_Player[playerid])
- {
- HackDetect(playerid, Hack_Colete);
- return 0x01;
- }
- else
- {
- Verificar_2(playerid);
- return 0x01;
- }
- }
- forward Verificar_2(playerid);
- public Verificar_2(playerid)
- {
- new IdArma = GetPlayerWeapon(playerid);
- if(IdArma > 0)
- {
- for(new i = 0; i < ArmasProibidas; i++)
- {
- if(IdArma == Armas_Proibidas[0][i])
- {
- HackDetect(playerid, Hack_Arma_1);
- return 0x01;
- }
- }
- new weapons[13][2];
- for(new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); //Ainda acho que usei muitas loops :(
- for(new j = 0; j < ArmasProibidas; j++)
- {
- if(Armas_Proibidas[0][j] == weapons[i][0])
- {
- HackDetect(playerid, Hack_Arma_2);
- return 0x01;
- }
- }
- }
- }
- else
- {
- Verificar_3(playerid);
- return 0x01;
- }
- return 0x01;
- }
- forward Verificar_3(playerid);
- public Verificar_3(playerid)
- {
- //Passou Todas as Opções
- HackDetect(playerid, Limpo);
- return 0x01;
- }
- //Banir ou Voltar a vida do Jogador
- HackDetect(playerid, tipo)
- {
- new string[128];
- if(tipo == Hack_Vida)
- {
- format(string, sizeof(string), "[Cheats] Jogador: %s Foi banido | Motivo: Health Hack", ReturnPlayer(playerid));
- SendClientMessageToAll(-1, string);
- Kick(playerid);
- return 0x01;
- }
- else if(tipo == Hack_Colete)
- {
- format(string, sizeof(string), "[Cheats] Jogador: %s Foi banido | Motivo: Armour Hack", ReturnPlayer(playerid));
- SendClientMessageToAll(-1, string);
- Kick(playerid);
- return 0x01;
- }
- else if(tipo == Hack_Arma_1)
- {
- format(string, sizeof(string), "[Cheats] Jogador: %s Foi banido | Motivo: Weapon Hack Tipo 1", ReturnPlayer(playerid));
- SendClientMessageToAll(-1, string);
- Kick(playerid);
- return 0x01;
- }
- else if(tipo == Hack_Arma_2)
- {
- format(string, sizeof(string), "[Cheats] Jogador: %s Foi banido | Motivo: Weapon Hack Tipo 2", ReturnPlayer(playerid));
- SendClientMessageToAll(-1, string);
- Kick(playerid);
- return 0x01;
- }
- else if(tipo == Limpo)
- {
- SetPlayerHealth(playerid, Vida_Player[playerid]);
- SetPlayerArmour(playerid, Colete_Player[playerid]);
- format(string, sizeof(string), "[Cheats] Jogador: %s Passou no teste de Cheat's", ReturnPlayer(playerid));
- SendClientMessageToAll(-1, string);
- return 0x01;
- }
- else if(tipo == Interior)
- {
- SetPlayerHealth(playerid, Vida_Player[playerid]);
- SetPlayerArmour(playerid, Colete_Player[playerid]);
- format(string, sizeof(string), "[Cheats] Jogador: %s | Erro (Interior)", ReturnPlayer(playerid));
- SendClientMessageToAll(-1, string);
- return 0x01;
- }
- return 0x01;
- }
- //Pegar Nick do Jogador
- stock ReturnPlayer(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- return name;
- }
- stock IsNumeric(const num[])
- {
- for (new i = 0, j = strlen(num); i < j; i++)
- if (num[i] > '9' || num[i] < '0')
- return 0;
- return 0x01;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement