anti cheat not working, - 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: anti cheat not working, (
/showthread.php?tid=117595)
anti cheat not working, -
`FuTuRe- - 31.12.2009
When someone used a minigun and rocket launcher he didn't got banned ;(
Anyone knows the reason?
pawn Код:
public AntiHackCheat()
{
new string[128];
for (new i = 0; i < MAX_PLAYERS; i++)
{
switch(GetPlayerWeapon(i))
{
case 9, 17, 36, 37, 38, 39, 40, 42, 44, 45, 47:
{
new killer[MAX_PLAYER_NAME];
GetPlayerName(i, killer, sizeof(killer));
if(GetPlayerWeapon(i) == 18)
{
format(string, sizeof(string), "[ANTI-CHEAT] %s was banned, Reason: [WEAPON HACKING]", killer);
}
else
{
format(string, sizeof(string), "[ANTI-CHEAT]: %s was banned, Reason: [WEAPON HACKING]", killer);
}
SendClientMessageToAll(GAME_ENGINE, string);
printf("[ANTI-CHEAT] %s has just been banned, defined Reason: [WEAPON HACKING]", killer);
Ban(i);
}
}
}
return 1;
}
Re: anti cheat not working, -
KnooL - 31.12.2009
I think you need a timer that loops that public (checks)
Re: anti cheat not working, -
Calon - 01.01.2010
That's messy as hell.
pawn Код:
public AntiHackCheat()
{
new string[128], tmpname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
switch(GetPlayerWeapon(i))
{
case 9, 17, 36, 37, 38, 35, 39, 40, 42, 44, 45, 47:
{
GetPlayerName(i, tmpname, sizeof(tmpname));
format(string, sizeof(string), "Hohoho, %s has been auto-banned for weapon hacking.", tmpname);
SendClientMessageToAll(GAME_ENGINE, string);
print(string); // I don't have a clue why you're printing a string that has already been formatted, and formatting it again in printf()
Ban(i);
}
}
}
return 1;
}