/* NÃO RETIRE OS CREDITOS !! NÃO RETIRE OS CREDITOS !! SISTEMA ANTI-ESC .d8888b. 888 888 888888888 d88P Y88b 888 888 888 Y88b. 888 888 888 "Y888b. 88888b. 8888b. .d88888 .d88b. 888 888 888 888 888 888 8888888b. "Y88b. 888 "88b "88b d88" 888 d88""88b 888 888 888 888 888 888 "Y88b "888 888 888 .d888888 888 888 888 888 888 888 888 888 888 888 888 Y88b d88P 888 888 888 888 Y88b 888 Y88..88P Y88b 888 d88P Y88b 888 d88P Y88b d88P "Y8888P" 888 888 "Y888888 "Y88888 "Y88P" "Y8888888P" "Y8888888P" "Y8888P" http://forum.sa-mp.com/member.php?u=123990 */ #include forward AntiEsc(pID, Float:X, Float:Y, Float:Z); public OnFilterScriptInit() { print("--------------------------------------"); print(" ANTI-ESC CARREGADO COM SUCESSO"); print(" Criado por Shadoww5"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { print("--------------------------------------"); print(" ANTI-ESC DESCARREGADO"); print(" Criado por Shadoww5"); print("--------------------------------------\n"); return 1; } public OnPlayerConnect(playerid) return SendClientMessage(playerid,0xFFFF00FF," Este servidor usa o Sistema ANTI-ESC - Desenvolvido por Shadoww5"); public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256], idx; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/esc", true) == 0) { new id[256], acusado, Float:Pos[3]; if(GetTickCount() - GetPVarInt(playerid, "Tick") < 120000) return SendClientMessage(playerid, 0xFFFFFFAA, " Aguarde 2 minutos para acusar outra pessoa novamente !"); id = strtok(cmdtext,idx); if(!strlen(id)) return SendClientMessage(playerid, 0xFFFFFFFF, "USO: /esc [playerid/Parte-do-Nick]"); acusado = strval(id); if(!IsPlayerConnected(acusado)) return SendClientMessage(playerid, 0xFFFFFFAA, " O jogador está OFFLINE."); GetPlayerPos(acusado, Pos[0], Pos[1], Pos[2]); if(!IsPlayerInRangeOfPoint(playerid, 5.0, Pos[0], Pos[1], Pos[2])) return SendClientMessage(playerid, 0xFFFFFFAA, " Você está longe do acusado !"); SendClientMessage(playerid, 0xAFAFAFAA, " Você acusou alguem de estar de ESC"); SendClientMessage(acusado, 0xFFFF00FF, " Você foi acusado de estar de ESC. Mova-se ou será kickado !"); SetPVarInt(playerid, "Tick", GetTickCount()); SetTimerEx("AntiEsc", 5000, false, "dfff", acusado, Pos[0], Pos[1], Pos[2]); return 1; } return 0; } public AntiEsc(pID, Float:X, Float:Y, Float:Z) { new Float:Pos[3], nome[MAX_PLAYER_NAME]; GetPlayerPos(pID, Pos[0], Pos[1], Pos[2]); GetPlayerName(pID,nome,sizeof(nome)); if(Pos[0] == X && Pos[1] == Y && Pos[2] == Z) { new string[75]; SendClientMessage(pID,0xFF0000FF, " Você foi kickado por estar de ESC !"); Kick(pID); format(string,sizeof(string)," %s foi kickado por ESC/RT !", nome); SendClientMessageToAll(0x04D62EFF, string); } else { SendClientMessage(pID,0xFFFF00FF, " Você se moveu e por isso não será kickado."); } return 1; } strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }