[HELP] anti money hack problem X_X
#1

help me guys... something wrong with my anti money hack...
i use servermoneyGM.inc

i have a problem like this:

-i have 5000$ in game
then i go to Payn'Spray.. after the car have been fixed,, the money reduce to 4900$ then back again to 5000$
weird...

the 2nd.
-when i modify a car.. the money same as above.. the money get back again..

the 3rd
-gun shop, and another shop.. same as above ...

very weird...

can any body help me??

the servermoneyGM.inc goes like this
Код:
/**************************************************
  Name: Server-sided money INC for gamemodes
  By: X_Cutter
  Date: Project started 09/2009, rewritten 09/2010
  Use: Avoid money hacks
  Version: 5.0
  SA-MP: All versions should work
  Made for: 0.3b
 **************************************************
  CREDITS: ****** for the y_hooks include

   Use: Include '#include <servermoneyGM>' to your gamemode
   RIGHT UNDER '#include <a_samp>'. Also make sure to include
   '#include <servermoneyFS>' in all your filterscripts
   RIGHT UNDER '#include <a_samp>'.
   Use OnPlayerHaveExtraCash(playerid,extramoney) at the 
   bottom of this include to set what happens to a player
   who might be hacking.
   *NOTE: Add the YSI folder to your server includes!
*/
#include <YSI/y_hooks>
new SERVERSIDETIMER;
new ServerSideCash[MAX_PLAYERS];
Hook:Money_OnGameModeInit()
{
	SERVERSIDETIMER=SetTimer("ServerMoneyCB",1000,true);
	return 1;
}
Hook:Money_OnGameModeExit()
{
	KillTimer(SERVERSIDETIMER);
	return 1;
}
Hook:Money_OnPlayerConnect(playerid)
{
	ServerSideCash[playerid]=0;
}
forward ServerMoneyCB();
public ServerMoneyCB()
{
	for(new ServerSidep;ServerSidep<MAX_PLAYERS;ServerSidep++)
	{
		if(IsPlayerConnected(ServerSidep))
		{
			if(GetPlayerMoney(ServerSidep) > ServerSideCash[ServerSidep])
			{
				new H4xc4sh=GetPlayerMoney(ServerSidep);
				H4xc4sh=H4xc4sh-ServerSideCash[ServerSidep];
				if(H4xc4sh > 100) OnPlayerHaveExtraCash(ServerSidep,H4xc4sh);
			}
			GivePlayerMoney(ServerSidep,-GetPlayerMoney(ServerSidep));
			GivePlayerMoney(ServerSidep,ServerSideCash[ServerSidep]);
		}
		
	}
	return 1;
}

forward Money_GivePlayerMoney(playerid,cashgiven);
public Money_GivePlayerMoney(playerid,cashgiven)
{
	ServerSideCash[playerid]=ServerSideCash[playerid]+cashgiven;
	return 1;
}
forward Money_ResetPlayerMoney(playerid);
public Money_ResetPlayerMoney(playerid)
{
	ServerSideCash[playerid]=0;
	return 1;
}
forward Money_GetPlayerMoney(playerid);
public Money_GetPlayerMoney(playerid)
{
	return ServerSideCash[playerid];
}
#define GetPlayerMoney Money_GetPlayerMoney
#define GivePlayerMoney Money_GivePlayerMoney
#define ResetPlayerMoney Money_ResetPlayerMoney
// --------------------------------------------------
stock OnPlayerHaveExtraCash(playerid,extramoney)
{
	new CASHSTR[128];
	format(CASHSTR,128,"This server is protected from money hacking",extramoney);
	SendClientMessage(playerid,0xFF0000FF,CASHSTR);
	return 1;
}
please guys... help me
sorry for my bad english
Reply
#2

anyone ?
Reply
#3

Quote:
Originally Posted by leingod
Посмотреть сообщение
anyone ?
https://sampwiki.blast.hk/wiki/OnVehicleRespray
https://sampwiki.blast.hk/wiki/OnVehiclePaintjob
https://sampwiki.blast.hk/wiki/OnVehicleMod

Read, read & read.
Reply
#4

PM ME IF YOU WANT FULL CODE
Код:
#include <a_samp>
 
#define SLOTS (500)
 
#define MAX_MONEY 99999999
#define MAX_AVISOS_HACK 5
 
new AvisosHack[SLOTS];
new Cash[SLOTS];
 
stock MoneyHack()
{
    print("\n-----------------------------------------------------------------");
    print("* ANTI_MH by Bilawal *");
    printf("Cel Mai Tare %d |",MAX_MONEY,MAX_AVISOS_HACK);
    print("--------------------------------------------------------------\n");
        new HackFile[26];
    format(HackFile, sizeof HackFile,"MoneyHack.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  Anti Money Hack",name);
                SendMessageToAdmins(0xFFFF00AA,string);
                SalvarAquivo(string);
                AvisosHack[a]++;
                if(AvisosHack[a] > MAX_AVISOS_HACK)
                {
                        SendClientMessage(a,0xFFFF00AA,"Exces de Money Hack");
                        BanEx(a,"Money-Hack by X");
                        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("MoneyHack.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;
}
Reply
#5

In the anti-cheat timer, check if the amount of money is MORE then the cash variable.
Then it wont reset the money if you get less then before.

pawn Код:
if(GetPlayerMoney(playerid) > Cash[playerid])
I doubt someone would hack so they get less money then they have. That'd be stupid.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)