PDA

View Full Version : How to add a Anticheat Exception


DexterBR
01/12/2012, 12:47 PM
I wanna add exception for Casinos. The AC system dont recognizes the money you earn in it, as if it were 'out of play', cuz is a RPG server that transactions must be between players.


if(AntiMoneyHack == 1)
{
if(PlayerGotSpottedRecently[i] == 0)
{
if(!IsAtCandySprunk(i))
{
if(GetPlayerMoney(i) != ScriptMoney[i])
{
if(ScriptMoneyUpdated[i] == 0)
{
if(IsAtPaySpray(i) || IsAtTransfender(i))
{
SetRealMoney(i, GetPlayerMoney(i));
}
if((GetPlayerMoney(i) - ScriptMoney[i]) >= 500 && (GetPlayerMoney(i) - ScriptMoney[i]) != 0)
{
if(admins == 0 || afkadmins == admins)
{
format(string, sizeof(string), "%s (%d), Has been kicked by Anticheat for Possible Money Hacking.", plname, i);
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "You have Been Kicked by The Anticheat For Possible Weapon Money Hacking ($%d)",(GetPlayerMoney(i) - ScriptMoney[i]));
SendClientMessage(i,COLOR_LIGHTBLUE, string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Anticheat Has Kicked %s for: Money Hacking ($%d)",d,m,y,h,mi,s,plname,(GetPlayerMoney(i) - ScriptMoney[i]));
KickLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Kicked by the Anticheat - Money Hacking.",d,m,y,h,mi,s,plname);
AddPunishment(i, string);
Kick(i);
}
format(string, sizeof(string), "[AC]: %s (%d) Is possibly Using Money Hacks; Use /spec and check him!", plname, i);
SendAdminMessage(COLOR_YELLOW, string);
PlayerSuspicious[i] = 1;
PlayerMoneyHacking[i] = 1;
PlayerSuspiciousMoney[i] = (GetPlayerMoney(i) - ScriptMoney[i]);
PlayerGotSpottedRecently[i] = 1;
SetTimerEx("ResetAcWarn", 300000, 0, "i", i);
}
else
{
if((GetPlayerMoney(i) - ScriptMoney[i]) >= 1)
{
format(string, sizeof(string), "[AC]: %s (%d) Is Bugged on a Cash Inbalance, Check him inmediately!!", plname, i);
SendAdminMessage(COLOR_YELLOW, string);
PlayerSuspicious[i] = 1;
PlayerOnCashInbalance[i] = 1;
PlayerSuspiciousMoney[i] = (GetPlayerMoney(i) - ScriptMoney[i]);
PlayerGotSpottedRecently[i] = 1;
SetTimerEx("ResetAcWarn", 90000, 0, "i", i);
}
}
}
}
}
}
}

DexterBR
01/12/2012, 03:34 PM
Anyone? Sorry for bump.

Faisal_khan
01/12/2012, 03:36 PM
Check if the player's in the casino then check if he is controllable. Maybe this will work, but there are still ways for exploiting this.

DexterBR
01/12/2012, 04:52 PM
I dont understand man :(
How can i put 'Money of Casino' legal?

Memoryz
01/12/2012, 05:05 PM
Check for a certain interior that the person is in, if they are in that interior, allow their money to increase.

DexterBR
01/12/2012, 08:35 PM
Check for a certain interior that the person is in, if they are in that interior, allow their money to increase.

Its what i want to do, but how can i?

Konstantinos
01/12/2012, 08:42 PM
Check in OnPlayerUpdate, if player's interior is equal to the casino's interior skip it.
An example would be

// --
if(GetPlayerMoney(i) != ScriptMoney[i])
{
if(GetPlayerInterior(i) == 1 || GetPlayerInterior(i) == 10 || GetPlayerInterior(i) == 12) continue; // if the interiors are from Casino, skip that.
if(ScriptMoneyUpdated[i] == 0)
{
// rest

DexterBR
01/12/2012, 09:04 PM
Look, I tried this:

if(AntiMoneyHack == 1)
{
if(IsPlayerInRangeOfPoint(i, 200, 2235.9165, 1603.2797, 1006.1818)){
SetRealMoney(i, GetPlayerMoney(i));
}else{
if(PlayerGotSpottedRecently[i] == 0)
{
if(Checked[i] == 0)
{
if(!IsAtCandySprunk(i))
{
if(GetPlayerMoney(i) != ScriptMoney[i])
{
if(ScriptMoneyUpdated[i] == 0)
{
if(IsAtPaySpray(i))
{
SetRealMoney(i, GetPlayerMoney(i));
}

if(IsAtTransfender(i))
{
SetRealMoney(i, GetPlayerMoney(i));
}
if((GetPlayerMoney(i) - ScriptMoney[i]) >= 500)
{
if(admins == 0 || afkadmins == admins)
{
format(string, sizeof(string), "%s (%d), Foi Kickado pelo Anticheat Need_Ziinho Por Possivel Money Hack.", plname, i);
SendClientMessageToAll(COLOR_NICERED, string);
format(string, sizeof(string), "VocÍ Foi Kickado pelo Anticheat Need_Ziinho Por Possivel Money Hack (R$%d)",(GetPlayerMoney(i) - ScriptMoney[i]));
SendClientMessage(i,COLOR_LIGHTBLUE, string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Anticheat Kickou %s por: Money Hack (R$%d)",d,m,y,h,mi,s,plname,(GetPlayerMoney(i) - ScriptMoney[i]));
KickLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Kickado Pelo Anticheat - Money Hack.",d,m,y,h,mi,s,plname);
AddPunishment(i, string);
Kick(i);
}
format(string, sizeof(string), "[AntiCheat]: %s (%d) EstŠ Possivelmente Usando Money Hack; Cheque-o Imediatamente!!", plname, i);
SendAdminMessage(COLOR_YELLOW, string);
PlayerSuspicious[i] = 1;
PlayerMoneyHacking[i] = 1;
PlayerSuspiciousMoney[i] = (GetPlayerMoney(i) - ScriptMoney[i]);
PlayerGotSpottedRecently[i] = 1;
SetTimerEx("ResetAcWarn", 300000, 0, "i", i);
}
else
{
format(string, sizeof(string), "[Anticheat]: %s (%d) EstŠ bugado na Estimativa De Dinheiro, Cheque-o imediatamente!!", plname, i);
SendAdminMessage(COLOR_YELLOW, string);
PlayerSuspicious[i] = 1;
PlayerOnCashInbalance[i] = 1;
PlayerSuspiciousMoney[i] = (GetPlayerMoney(i) - ScriptMoney[i]);
PlayerGotSpottedRecently[i] = 1;
SetTimerEx("ResetAcWarn", 90000, 0, "i", i);
}

}
}
}
}
}
}
}

But i have some bugs yet.
Now, you are not kicked, but you cant win or lose money too. This script that I worked, is now returning the money to 'Normal Money', always when have some change.

DexterBR
01/12/2012, 10:09 PM
Anyone? Sorry for bump.

DexterBR
02/12/2012, 02:27 AM
Sorry for Bump Topic Again, can anyone help here?

cessil
02/12/2012, 05:01 AM
you have been told exactly what to do, if you don't understand anything then go look it up on the wiki, I don't know how you could get any more help other than being given the whole script and if you want that then go post in the script request thread