Anti Health Hack -
Rocketeer - 31.07.2011
Hey everyone, so i was thinking, is this possible to make it
1. admin takes away health from a player
2. player is using health hack - his health comes right back to a 100
3. create a timer and see if players health comes back faster then for example 2 seconds.
Would this be possible to create? Also if i am wrong and sound stupid with my health hack theory, sorry i haven't used hacks so i am not sure how they work. Here is a piece of code, if anyone have any idea please help.
Код:
CMD:hh(playerid, params[])
{
if(PVar[playerid][pLevel] >= 1)
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "(Usage) /hh (ID)");
if(!IsPlayerConnected(strval(params))) return SendClientMessage(playerid, COLOR_RED, "(Server) Player is not on server.");
return SetPlayerHealth(strval(params), 70.0);
}
else return SendClientMessage(playerid, COLOR_RED, "(Server) You are not an administrator.");
}
Re: Anti Health Hack -
wups - 31.07.2011
Check JunkBuster's Anti god mode.
Re: Anti Health Hack -
Kingunit - 31.07.2011
What I'm using on my server is;
Creating a little explode on the person. System checks if the HP is still 100 and then it's returning the result to the administrator. So it's possible
Re: Anti Health Hack -
Rocketeer - 31.07.2011
Kingunit, care to share a code or no haha?
Re: Anti Health Hack -
LetsOWN[PL] - 31.07.2011
@Rocketeer, I don't know, that this will works, but give it a try.
(NOTE: It's in ZCMD :P)
pawn Код:
COMMAND:explode(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) // If playerid isn't RCON admin
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are not {FF0000}Server Admin!");
return 1;
}
new PlayerId;
if(sscanf(params, "u", PlayerId))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Try again. Usage:{FF0000 }/explode [user id]");
return 1;
}
new Float:Pos[3];
GetPlayerPos(PlayerId, Pos[0], Pos[1], Pos[2]);
SendClientMessage(PlayerId, 0xFF0000FF, "Admin has {FF0000}exploded{FFFFFF} you..");
CreateExplosion(Pos[0], Pos[1], Pos[2], 2, 10.0);
SetTimerEx("AmICheater",50,false,"d",PlayerId);
return 1;
}
forward AmICheater(PlayerId);
public AmICheater(PlayerId)
{
new Float:HP;
HP = GetPlayerHealth(PlayerId);
if(HP == 100 && !IsPlayerAdmin(playerid)) // If player health equals 100 (even after 50 ms after bum :O). And checks if PlayerId isn't a RCON Admin :P
{
SendClientMessage(playerid, 0xFFFFFFFF, "You're cheater :( See you");
Ban(playerid);
return 1;
}
return 1;
}
I don't know that this will works.. I wrote it with notepad, so..
Hope it works, it just a littile sample
Greetz,
Lets.
Re: Anti Health Hack -
Kingunit - 31.07.2011
Quote:
Originally Posted by LetsOWN[PL]
@Rocketeer, I don't know, that this will works, but give it a try.
(NOTE: It's in ZCMD :P)
pawn Код:
COMMAND:explode(playerid, params[]) { if(!IsPlayerAdmin(playerid)) // If playerid isn't RCON admin { SendClientMessage(playerid, 0xFFFFFFFF, "You are not {FF0000}Server Admin!"); return 1; } new PlayerId; if(sscanf(params, "u", PlayerId)) { SendClientMessage(playerid, 0xFFFFFFFF, "Try again. Usage:{FF0000 }/explode [user id]"); return 1; }
new Float:Pos[3]; GetPlayerPos(PlayerId, Pos[0], Pos[1], Pos[2]);
SendClientMessage(PlayerId, 0xFF0000FF, "Admin has {FF0000}exploded{FFFFFF} you..");
CreateExplosion(Pos[0], Pos[1], Pos[2], 2, 10.0); SetTimerEx("AmICheater",50,false,"d",PlayerId); return 1; } forward AmICheater(PlayerId); public AmICheater(PlayerId) { new Float:HP; HP = GetPlayerHealth(PlayerId);
if(HP == 100 && !IsPlayerAdmin(playerid)) // If player health equals 100 (even after 50 ms after bum :O). And checks if PlayerId isn't a RCON Admin :P { SendClientMessage(playerid, 0xFFFFFFFF, "You're cheater :( See you"); Ban(playerid); return 1; } return 1; }
I don't know that this will works.. I wrote it with notepad, so..
Hope it works, it just a littile sample
Greetz,
Lets.
|
Yes I have also something like that. But if I drop my code here it doens't work since it's not ZCMD.
By the way, don't automatic ban the player, maybe something is going wrong and than the player is banned for nothing. Just create a message like Result: [NEGATIVE] or Result: [POSITIVE]
Re: Anti Health Hack -
Rocketeer - 31.07.2011
When i put in this code
Код:
forward AmICheater(PlayerId);
public AmICheater(PlayerId)
{
new Float:HP;
HP = GetPlayerHealth(PlayerId);
if(HP == 100 && !IsPlayerAdmin(playerid)) // If player health equals 100 (even after 50 ms after bum :O). And checks if PlayerId isn't a RCON Admin :P
{
SendClientMessage(playerid, 0xFFFFFFFF, "You're cheater :( See you");
Ban(playerid);
return 1;
}
return 1;
}
I get This
Код:
C:\Users\Andrew\Desktop\Los Santos Gang Wars MySql\gamemodes\Gangwars.pwn(844) : warning 202: number of arguments does not match definition
C:\Users\Andrew\Desktop\Los Santos Gang Wars MySql\gamemodes\Gangwars.pwn(846) : error 017: undefined symbol "playerid"
C:\Users\Andrew\Desktop\Los Santos Gang Wars MySql\gamemodes\Gangwars.pwn(848) : error 017: undefined symbol "playerid"
C:\Users\Andrew\Desktop\Los Santos Gang Wars MySql\gamemodes\Gangwars.pwn(849) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
This is 843 line
HP = GetPlayerHealth(PlayerId);
Re: Anti Health Hack -
Famalamalam - 31.07.2011
pawn Код:
forward AmICheater(playerid);
public AmICheater(playerid)
Re: Anti Health Hack -
Rocketeer - 31.07.2011
Same error
(844) : warning 202: number of arguments does not match definition
Re: Anti Health Hack -
LetsOWN[PL] - 31.07.2011
Aaah.. Sorry

"(844) : warning 202: number of arguments does not match definition "
Edit:
pawn Код:
new Float:HP;
GetPlayerHealth(PlayerId, HP);
.
And here's another try:
pawn Код:
COMMAND:explode(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) // If playerid isn't RCON admin
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are not {FF0000}Server Admin!");
return 1;
}
new PlayerId;
if(sscanf(params, "u", PlayerId))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Try again. Usage:{FF0000 }/explode [user id]");
return 1;
}
new Float:Pos[3];
GetPlayerPos(PlayerId, Pos[0], Pos[1], Pos[2]);
SendClientMessage(PlayerId, 0xFF0000FF, "Admin has {FF0000}exploded{FFFFFF} you..");
CreateExplosion(Pos[0], Pos[1], Pos[2], 2, 10.0);
CheckIsGod(PlayerId);
return 1;
}
// ******************
stock CheckIsGod(PlayerId)
{
new Float:HP;
GetPlayerHealth(PlayerId, HP); // Edited!
if(HP == 100)
return true;
else if(HP < 100)
return false;
return false;
}
And again.. Does it works or not. Try it.
Okey, now I will explain you.
Funct "CheckIsGod" will return true, if player will have 100 hp, and return false if player has hp less than 100.
Now you're able to use this condition:
While you use something like above, script will be continued, if function has lastly return true.
Example:
pawn Код:
public OnPlayerUpdate(playerid)
{
if(CheckIsGod(playerid))
{
// Do something here, if this function returned true
}
return 1;
}
CheckIsGod will return true or false ONLY under condition, that this were used (in this case) on command 'explode'.
That's it?
Re: Anti Health Hack -
Rocketeer - 31.07.2011
When i connected to server i was spammed with msgs your cheating. just because i had 100hp
Re: Anti Health Hack -
Kingunit - 31.07.2011
Quote:
Originally Posted by Rocketeer
When i connected to server i was spammed with msgs your cheating. just because i had 100hp
|
When you entered the server or when you did the command?
Re: Anti Health Hack -
Rocketeer - 31.07.2011
When i spawned, the CheckisGod should only be called after using command, but its being called 25 times a second because of OnPlayerupdate ;(
Re: Anti Health Hack -
LetsOWN[PL] - 31.07.2011
@Kingunit, After he just join the server, I guess.
Well, you can also have some fun with enums, and do something like this:
pawn Код:
enum Blabla {
Loled
}
Trololol[MAX_PLAYERS][Blabla];
public OnPlayerConnect(playerid)
{
Trololol[playerid][Loled] = false
return 1;
}
CMD:explode(playerid, params[])
{
...
Trololol[playerid][Loled] = true;
return 1;
}
stock CheckIsGod(PlayerId)
{
new Float:HP;
GetPlayerHealth(PlayerId, HP); // Edited!
if(HP == 100 && Player[playerid][Loled])
return true;
else if(HP < 100)
return false;
return false;
}
Do not use it "OnPlayerUpdate"

Try code that i provided above.
Re: Anti Health Hack -
Rocketeer - 31.07.2011
I am not that good of a scripter ;(
[ame]http://www.youtube.com/watch?v=2Z4m4lnjxkY&feature=fvst[/ame]
Re: Anti Health Hack -
Kingunit - 31.07.2011
<cut>
Re: Anti Health Hack -
LetsOWN[PL] - 31.07.2011
Quote:
TogglePlayerControllable(targetid, 1);
new msg[MAX_STRING];
SetPlayerArmour(targetid,0);
SetPlayerHealth(targetid,100);
checkinv = 1;
new Float ,Float:y,Float:z;
GetPlayerPos(targetid,x,y,z);
CreateExplosion(x, y, z, 12, 2.0);
SetTimerEx("Explosion",500,0,"ii", targetid, playerid);
format(msg,sizeof(msg),""#COL_ORANGE"[ADMIN] "#COL_LRED"%s was checked for Invulnerability HAX.",PlayerName(targetid));
SendClientMessage(playerid,COLOR_WHITE, msg);
SetPlayerArmour(targetid,99);
SetPlayerHealth(targetid,99);
|
Emm? I do not understand this part of the code.
'targetid' gets disarmoured and his health is set to 100, Server creates explode under it, then set timer, sending message to playerid and the armour and health of targetid is set to 99?
What it does? And where's the "public Explosion"?

Because timer which isn't scripted does.. Nothin..
And PS: D
"I am not that good of a scripter ;(" - Don't worry, just keep learning
Re: Anti Health Hack -
Rocketeer - 31.07.2011
Thanks haha, anyways i still didnt solve problem
Re: Anti Health Hack -
LetsOWN[PL] - 31.07.2011
@Rock, i will write an filterscript, which I will send you via PM.
So smile, and wait ;P
Re: Anti Health Hack -
Kingunit - 31.07.2011
Quote:
Originally Posted by LetsOWN[PL]
Emm? I do not understand this part of the code.
'targetid' gets disarmoured and his health is set to 100, Server creates explode under it, then set timer, sending message to playerid and the armour and health of targetid is set to 99?
What it does? And where's the "public Explosion"?  Because timer which isn't scripted does.. Nothin..
And PS: D
"I am not that good of a scripter ;(" - Don't worry, just keep learning 
|
What my script is doing is:
Setting armour player to 0
Creating a little explode.
Check if player is losing health after the explode.
Send the message to the administrator if he HP hacks or not.
Restoring the Armour + Health