Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Não adianta mudar os creditos não foi você que fez
- Server: 167.114.42.20:7762
- Por padrão o anti money hack vem desligado
- Se etiver usando outro metodo de salvamento de money retire ele o anti cheat ja vem com o sistema para salvar money
- */
- //Includes
- #include <a_samp>
- #include <zcmd>
- #include <bini>
- //define's
- #define DIALOG_ANTICHEAT 9999
- //variaveis
- static kickado[MAX_PLAYERS];// para não floodar o chat
- static AntiFakeKill[MAX_PLAYERS];
- static PlayerTimer1[MAX_PLAYERS];// timer do AntiMoneyHack
- static PlayerTimer2[MAX_PLAYERS];// timer do CheckCheat
- static money[MAX_PLAYERS];//variavel do anti money hack
- static string[124];
- static antifake,antiskin,antifly,antimoney;
- //////////////////////////////////////////////////////////////////
- public OnFilterScriptInit()
- {
- for(new x = 0; x < GetMaxPlayers(); ++x)// ser voce usar em /rcon loadfs ele vai recarregar o sistema
- {
- if(IsPlayerConnected(x))
- {
- PlayerTimer1[x] = SetTimerEx("MF_AntiMoneyHack", 1000, true, "i", x);
- PlayerTimer2[x] = SetTimerEx("CheckCheat", 1000,true,"i",x);
- }
- }
- // Carregar configurações
- if(fexist("MF_CONFIG.ini"))
- {
- INI_Open("MF_CONFIG.ini");
- antifake = INI_ReadInt("MF_CONFIG.ini", "antifake");
- antiskin = INI_ReadInt("MF_CONFIG.ini", "antiskin");
- antifly = INI_ReadInt("MF_CONFIG.ini", "antifly");
- antimoney = INI_ReadInt("MF_CONFIG.ini", "antimoney");
- INI_Close();
- print("1 = Ativado | 0 = Desativado");
- printf("Anti Fake Kill %d",antifake);
- printf("Anti Skin Bug %d",antiskin);
- printf("Anti FLy %d",antifly);
- printf("Anti Money Hack",antimoney);
- }else{
- INI_Create("MF_CONFIG.ini");
- INI_WriteInt("MF_CONFIG.ini", "antifake", antifake = 1);
- INI_WriteInt("MF_CONFIG.ini", "antiskin", antiskin = 1);
- INI_WriteInt("MF_CONFIG.ini", "antifly", antifly = 1);
- INI_WriteInt("MF_CONFIG.ini", "antimoney", antifly = 0);
- INI_Save();
- print("MF_CONFIG.ini / Criado");
- INI_Create("MF_MONEY.ini");
- print("MF_MONEY.ini / Criado");
- }
- print("\n----------------------------------------------");
- print(" Anti Cheat 1.1 By [$]_Red_[MF] Loaded");
- print(" Server ip: 167.114.42.20:7762\n");
- print("----------------------------------------------\n");
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- public OnFilterScriptExit() {
- INI_Exit();
- return true;
- }
- //////////////////////////////////////////////////////////////////
- public OnPlayerConnect(playerid)
- {
- if(antimoney == 1)
- {
- INI_Open("MF_MONEY.ini");
- MF_GivePlayerMoney(playerid, INI_ReadInt("MF_MONEY.ini", pName(playerid)));
- INI_Close();
- }
- PlayerTimer1[playerid] = SetTimerEx("MF_AntiMoneyHack", 1000, true, "i", playerid);
- PlayerTimer2[playerid] = SetTimerEx("CheckCheat", 1000,true,"i",playerid);
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- public OnPlayerDisconnect(playerid)
- {
- INI_Open("MF_MONEY.ini");
- INI_WriteInt("MF_MONEY.ini", pName(playerid), money[playerid]);
- INI_Save();
- kickado[playerid] = 0;
- KillTimer(PlayerTimer1[playerid]);
- KillTimer(PlayerTimer2[playerid]);
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(antifake == 1){
- AntiFakeKill[playerid]++;
- SetTimerEx("Antifakekill", 1000,false,"i",playerid);}
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- CMD:mf(playerid, params[])
- {
- Dialog(playerid);
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- CMD:money(playerid, params[])
- {
- if(antimoney == 1)
- {
- new stringmoney[64];
- format(stringmoney, 64, "Seu money: {FF0000}%d", money[playerid]);
- SendClientMessage(playerid, -1, stringmoney);
- }
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_ANTICHEAT)
- {
- if(response)
- {
- if(!IsPlayerAdmin(playerid)) return 1;
- INI_Open("MF_CONFIG.ini");
- if(listitem == 0){
- if(antifly == 1){
- antifly = 0;
- }else{
- antifly = 1;}}
- if(listitem == 1){
- if(antiskin == 1){
- antiskin = 0;
- }else{
- antiskin = 1;}}
- if(listitem == 2){
- if(antifake == 1){
- antifake = 0;
- }else{
- antifake = 1;}}
- if(listitem == 3){
- if(antimoney == 1){
- antimoney = 0;
- }else{
- for(new x = 0; x < GetMaxPlayers(); ++x)
- {
- if(IsPlayerConnected(x)){
- money[x] = GetPlayerMoney(x);
- }}// retirando umas linhas
- antimoney = 1;
- SendClientMessage(playerid, -1, "Se você estiver usando outro anti money hack por favor desligue para não cauzar conflito.");
- }}
- Dialog(playerid);
- // Salva as alterações feitas
- INI_WriteInt("MF_CONFIG.ini", "antifake", antifake);
- INI_WriteInt("MF_CONFIG.ini", "antiskin", antiskin);
- INI_WriteInt("MF_CONFIG.ini", "antifly", antifly);
- INI_WriteInt("MF_CONFIG.ini", "antimoney", antimoney);
- INI_Save();
- }
- return 1;
- }
- return 0;
- }
- //////////////////////////////////////////////////////////////////
- forward CheckCheat(playerid);
- public CheckCheat(playerid)
- {
- if(antiskin == 1){
- if(GetPlayerWeapon(playerid) != WEAPON_PARACHUTE && GetPlayerAnimationIndex(playerid) == 974 || GetPlayerWeapon(playerid) != WEAPON_PARACHUTE && GetPlayerAnimationIndex(playerid) == 972 || GetPlayerWeapon(playerid) != WEAPON_PARACHUTE && GetPlayerAnimationIndex(playerid) == 968){
- KickPlayer(playerid, "Skin Bug");}}
- if(antifly == 1){
- if(GetPlayerWeapon(playerid) != WEAPON_PARACHUTE && GetPlayerAnimationIndex(playerid) == 959 || !IsPlayerInWater(playerid) && GetPlayerAnimationIndex(playerid) == 1539 || GetPlayerWeapon(playerid) != WEAPON_PARACHUTE && GetPlayerAnimationIndex(playerid) == 958){
- static Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- if(z > 2) return 0;
- KickPlayer(playerid, "Fly");}}
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- forward Antifakekill(playerid);
- public Antifakekill(playerid)
- {
- if(AntiFakeKill[playerid] > 2){
- KickPlayer(playerid, "Fake Kill");
- }
- AntiFakeKill[playerid] = 0;
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- stock IsPlayerInWater(playerid)//by stabker http://forum.sa-mp.com/showthread.php?t=400049
- {
- static Float:Z;
- GetPlayerPos(playerid,Z,Z,Z);
- if(Z < 0.7) switch(GetPlayerAnimationIndex(playerid)) { case 1543,1538,1539: return 1; }
- if(GetPlayerDistanceFromPoint(playerid,-965,2438,42) <= 700 && Z < 45)return 1;
- static Float:water_places[][] =
- {
- {
- 25.0, 2313.0, -1417.0, 23.0},
- {
- 15.0, 1280.0, -773.0, 1082.0},
- {
- 15.0, 1279.0, -804.0, 86.0},
- {
- 20.0, 1094.0, -674.0, 111.0},
- {
- 26.0, 194.0, -1232.0, 76.0},
- {
- 25.0, 2583.0, 2385.0, 15.0},
- {
- 25.0, 225.0, -1187.0, 73.0},
- {
- 50.0, 1973.0, -1198.0, 17.0}
- };
- for(new t=0; t < sizeof water_places; t++)
- if(GetPlayerDistanceFromPoint(playerid,water_places[t][1],water_places[t][2],water_places[t][3]) <= water_places[t][0]) return 1;
- return 0;
- }
- /////////////////////////////////////////////////////////////////////
- stock pName(playerid)
- {
- static name[24];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- //////////////////////////////////////////////////////////////////
- forward KickPlayer(playerid, caso[]);
- public KickPlayer(playerid, caso[])
- {
- if(kickado[playerid] == 0){
- kickado[playerid]++;
- format(string, sizeof(string), "[ANTI-CHEAT]: %s foi kickado [Motivo: %s]", pName(playerid),caso);
- SendClientMessageToAll(-1, string);
- print(string);
- Kick(playerid);
- }
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- forward Dialog(playerid);
- public Dialog(playerid)
- {
- if(!IsPlayerAdmin(playerid)) return 1;
- static antifly2[30],antiskin2[30],antifake2[30],antimoney2[30];
- switch(antifly)
- {
- case 0: antifly2 = "{FF0000}Desativado{FFFFFF}";
- case 1: antifly2 = "{00FF00}Ativado{FFFFFF}";
- }
- switch(antiskin)
- {
- case 0: antiskin2 = "{FF0000}Desativado{FFFFFF}";
- case 1: antiskin2 = "{00FF00}Ativado{FFFFFF}";
- }
- switch(antifake)
- {
- case 0: antifake2 = "{FF0000}Desativado{FFFFFF}";
- case 1: antifake2 = "{00FF00}Ativado{FFFFFF}";
- }
- switch(antimoney)
- {
- case 0: antimoney2 = "{FF0000}Desativado{FFFFFF}";
- case 1: antimoney2 = "{00FF00}Ativado{FFFFFF}";
- }
- static config[200];
- format(config, sizeof config, "{FFFFFF}Anti Fly \t\t\t %s\nAnti Skin Bug \t\t %s\nAnti Fake kill \t\t %s\nAnti Money Hack \t %s",antifly2,antiskin2,antifake2,antimoney2);
- return ShowPlayerDialog(playerid, DIALOG_ANTICHEAT, DIALOG_STYLE_LIST, " CONFIGURAÇÔES DO ANTI CHEAT", config, "Selecionar", "Sair");
- }
- //////////////////////////////////////////////////////////////////
- forward MF_AntiMoneyHack(playerid);
- public MF_AntiMoneyHack(playerid)//MoneyCheatCheck
- {
- if(antimoney == 1)
- {
- if(GetPlayerMoney(playerid) > money[playerid])
- {
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, money[playerid]);
- }
- }
- return 1;
- }
- //////////////////////////////////////////////////////////////////
- /*
- Funsão para ser ultilizada fora do FS
- CallRemoteFunction("MF_GivePlayerMoney", "ii", playerid, quantidade);
- ================================================================
- Funsão para ser ultilizada dentro do FS
- MF_GivePlayerMoney(playerid, quantidade);
- */
- stock MF_GivePlayerMoney(playerid, quantidade)//GivePlayerMoney
- {
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, money[playerid] + quantidade);
- money[playerid] = GetPlayerMoney(playerid);
- return 1;
- }
- //////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement