Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define SLOTS (500)
- #define MAX_MONEY 99999999
- #define MAX_AVISOS_HACK 3
- new AvisosHack[SLOTS];
- new Cash[SLOTS];
- stock MoneyHack()
- {
- print("\n-----------------------------------------------------------------");
- print("*-*-*-**-* Sistema de Anti-MH Criado por DraKoN Iniciado *-*-*-*-*");
- printf("Configurações do [FS] | Max Money %d | Max de Avisos Hacks %d |",MAX_MONEY,MAX_AVISOS_HACK);
- print("--------------------------------------------------------------\n");
- new HackFile[26];
- format(HackFile, sizeof HackFile,"AvisosMoneyHack.log");
- if(!fexist(HackFile)) CriarArquivo(HackFile);
- SetTimer("CheckMoney",1000,true);
- return 1;
- }
- forward CheckMoney();
- public CheckMoney()
- {
- for(new a = 0 ; a <= SLOTS ; ++ a)
- {
- if(GetPlayerMoney(a) < GetPlayerCash(a))
- {
- ResetPlayerCash(a);
- GivePlayerCash(a,GetPlayerMoney(a));
- return 0;
- }
- if(GetPlayerMoney(a) > GetPlayerCash(a))
- {
- ResetPlayerMoney(a);
- GivePlayerMoney(a,GetPlayerCash(a));
- new name[MAX_PLAYER_NAME];
- new string[100];
- GetPlayerName(a, name, sizeof(name));
- format(string, sizeof(string), "%s Tentiva de Anti Money Hack",name);
- SendMessageToAdmins(0xFFFF00AA,string);
- SalvarAquivo(string);
- AvisosHack[a]++;
- if(AvisosHack[a] > MAX_AVISOS_HACK)
- {
- SendClientMessage(a,0xFFFF00AA,"Banido por Excesso de Tentativas de Money Hack");
- BanEx(a,"Money-Hack by Bot");
- AvisosHack[a]=0;
- }
- return 0;
- }
- }
- return 1;
- }
- stock comandos(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;
- }
- stock SendMessageToAdmins(color,const msg[])
- {
- for(new a = 0 ; a <= SLOTS ; ++ a)
- {
- if(IsPlayerConnected(a) && IsPlayerAdmin(a))
- {
- SendClientMessage(a,color,msg);
- }
- }
- return 1;
- }
- stock GivePlayerCash(playerid,valor)
- {
- Cash[playerid]+=valor;
- return 1;
- }
- stock GetPlayerCash(playerid)
- {
- new cashtotal;
- cashtotal = Cash[playerid];
- return cashtotal;
- }
- stock ResetPlayerCash(playerid)
- {
- Cash[playerid] = 0;
- return 1;
- }
- stock SalvarAquivo(const ahahah[])
- {
- new string[128];
- new File:HF = fopen("AvisosMoneyHack.log",io_append);
- format(string, sizeof (string), "%s \r\n", ahahah);
- fwrite(HF, string);
- fclose(HF);
- }
- stock CriarArquivo(filename[])
- {
- new File:files;
- if (fexist(filename)) return false;
- files=fopen(filename,io_write);
- fclose(files);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement