SA-MP Forums Archive
A little help with Anti - Money Hack. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A little help with Anti - Money Hack. (/showthread.php?tid=251792)



A little help with Anti - Money Hack. - Tee - 28.04.2011

Hello,

I have made an Anti- Money Hack. There is one problem though. I want to think that when you gamble the GivePlayerMoney function is called. That means that it would be impossible for players to gamble. Is there an alternative to this?

Thanks in Advance.


Re: A little help with Anti - Money Hack. - Bilawal2050 - 28.04.2011

here i post the code i hope its work its untestable check but i hope its work 100% sory for bad english
Quote:

//============================[Anti-Money]======================================
#define ResetMoneyBar ResetPlayerMoney
#define UpdateMoneyBar GivePlayerMoney
//=====================================forwords===== =============================
forward UpdateMoney();
//=============================[Timers]=========================================
SetTimer("UpdateMoney", 1000, 1);
//===========================[Anti-money hack]==================================
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;
}




Re: A little help with Anti - Money Hack. - Tee - 28.04.2011

This does not give player money when they gamble. Gambling would still call GivePlayerMoney.