Anti Money Hack Help -
milanosie - 15.02.2012
Hi there, I have a question.
I made a anti-money hack and on my ****** it detects it etc, but then DA_J (noob from the forum) joined and thought it would be funny to hack,
But for some reason it didn't detect his hacking, Wich is weird.
I used GivePlayerCash instead of Money
Then a variable is set to the amount of Cash the player has, if GetPlayerMoney != variable then the guy is hacking
What am I doing wrong?
Re: Anti Money Hack Help -
seanny - 15.02.2012
Let me see your code and I might be able to help you.
Re: Anti Money Hack Help -
milanosie - 15.02.2012
the forward is very simple:
pawn Код:
forward GivePlayerCash(playerid, Amoney);
public GivePlayerCash(playerid, Amoney)
{
money[playerid] = money[playerid] + Amoney;
GivePlayerMoney(playerid, Amoney);
return 1;
}
the check if he is hacking:
pawn Код:
forward MoneyCheck2(playerid);
public MoneyCheck2(playerid)
{
if(GetPlayerMoney(playerid) != money[playerid])
{
if(hackcheck[playerid] == 0)
{
new acount = 0;
foreach(Player, i)
{
if(PlayerInfo[i][AdminLevel] >= 1)
{
acount++;
}
}
if(acount > 0)
{
new string2[ 256 ];
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
new hackm = GetPlayerMoney(playerid) - money[playerid];
foreach(Player, i)
{
if(PlayerInfo[i][AdminLevel] >= 1)
{
format(string2, sizeof(string2), "%s is possibly money hacking! $%d. Use /fixcash to fix it or /fakefixcash if this is false alarm!", PlayerName, hackm);
SendClientMessage(i, COLOR_LIGHTRED, string2);
hackcheck[playerid] = 1;
SetTimerEx("hackcheck1", 30000, false, "i", playerid);
}
}
return 1;
}
SetPlayerCash(playerid, money[playerid]);
return 1;
}
return 1;
}
return 1;
}
Re: Anti Money Hack Help -
cessil - 15.02.2012
I'm guessing you're not setting the timers right, you could just use a loop with that instead of using a timer per player, you're also not taking into consideration lag where for example they could be given 100 then taken 100 off them, the script would read they should have 0, but if the client doesn't update fast enough then they could be banned.
read my AC tips n tricks link in my sig
Re: Anti Money Hack Help -
milanosie - 16.02.2012
I readed it, its really usefull but i dont understand why it does see that im hacking, but with those guys it doesnt
Re: Anti Money Hack Help -
WoodPecker - 16.02.2012
pawn Код:
#define ResetMoneyBar ResetPlayerMoney
#define UpdateMoneyBar GivePlayerMoney
forward UpdateMoney();
OnGameModeInit:
SetTimer("UpdateMoney", 1000, 1);
Wherever you want:
stock GivePlayerCash(playerid, money)
{
PlayerInfo[playerid][pCash] += money;
ResetMoneyBar(playerid);
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
return PlayerInfo[playerid][pCash];
}
stock SetPlayerCash(playerid, money)
{
PlayerInfo[playerid][pCash] = money;
ResetMoneyBar(playerid);
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
return PlayerInfo[playerid][pCash];
}
stock ResetPlayerCash(playerid)
{
PlayerInfo[playerid][pCash] = 0;
ResetMoneyBar(playerid);
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
return PlayerInfo[playerid][pCash];
}
stock GetPlayerCash(playerid)
{
return PlayerInfo[playerid][pCash];
}
public UpdateMoney()
{
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerCash(i) != GetPlayerMoney(i))
{
ResetMoneyBar(i);
UpdateMoneyBar(i,PlayerInfo[i][pCash]);
}
}
}
return 1;
}
Example:
GivePlayerCash(playerid, money);
Re: Anti Money Hack Help -
milanosie - 16.02.2012
And why would that make a difference