AntiCheat - 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)
+--- Thread: AntiCheat (
/showthread.php?tid=537213)
AntiCheat -
AdelS - 14.09.2014
Solved.
Re: AntiCheat -
TheNerka - 14.09.2014
OnPlayerUpdate
Код:
if(PlayerData[playerid][AdminLevel] < 3) // spam biggest than 3 lvl
{
if(GetPlayerSpeed(playerid, true) > 300) // if player speed higest than 300
{
format(string, sizeof(string), "[ADMIN]:{FFFFFF} %s (%d) cheating %d km/h.", GetPlayersName(playerid), playerid, GetPlayerSpeed(playerid, true));
SendAdministratorMessage(string);
}
}
if you want to see for cheater text
change from
SendAdministratorMessage(string);
to
Код:
new msg[128];
format(msg, sizeof(msg), "You speed is %d km/h. Please off cheats", GetPlayerSpeed(playerid, true));
SendClientMessage(playerid, -1, msg);
or send message to cheater and get warning
SetPlayerWantedLevel(playerid, 1); // he got 1 star
stock:
Код:
stock SendAdministratorMessage(message[])
{
AntiDeAMX();
foreach(Player, i)
{
if(PlayerData[i][AdminLevel] >= 1 && gIsPlayerLoggedIn[i] == 1)
{
SendClientMessage(i, COLOR_PALERED, message);
}
}
return 1;
}
on my server working
Re: AntiCheat -
Ricagor - 14.09.2014
Possible things are the hacker might be using hacks again and again and it is giving the warning again and again.
+rep if I helped u
Re: AntiCheat -
Thogy - 14.09.2014
You can use player variable to send message to admins only 1 time for 15 sec.
pawn Код:
new bool:Sended[MAX_PLAYERS];
YourFunctionToCheckIfPlayerHasSpeedHack()
{
if(Sended[cheaterid] != true)
{
SendClientMessageToAdmin("Player %s is using speed hack!");
Sended[cheaterid] = true;
SetTimerEx("CheckOn", 1000*15, false, "i", cheaterid);
}
}
forward CheckOn(cheaterid);
public CheckOn(cheaterid)
{
Sended[cheaterid] = false;
}
Re: AntiCheat -
AdelS - 14.09.2014
Thanks.