Detecting if player is Jetpack Hacking -
JaKe Elite - 20.05.2012
Anti-Jetpack Hack (Global Variable)
Tutorial Made by Romel
_________________________________
Tired seeing Hacker that use Jetpack hack around your server?
Tired banning them? This tutorial will teach you how to detect Jetpack Hack
that doesn't banned innocent people. 99% anticheat working!
Starting:
Open your script or open pawn.exe click new.
Now we are ready to start.
add this below the #includes
pawn Код:
new JetPack[MAX_PLAYERS];
This is Global Variable. we will use this for checking Jetpack Hack
i will tell you how to do it later.
now to avoid detecting that innocent people is using Jetpack Hack we need to add
pawn Код:
JetPack[playerid] = 1; //Setting our Global Variable JetPack to 1
in our command, Because later we will check if JetPack Global Variable is 0
Don't also forget to add
pawn Код:
JetPack[playerid] = 0; //Setting our Global Variable JetPack to 0 when OnPlayerConnect/Disconnect Called
OnPlayerConnect/Disconnect
now here is example of command JetPack in strcmp (This command will not detect as Hack)
pawn Код:
if(strcmp(cmdtext, "/jetpack", true) == 0)
{
if(JetPack[playerid] == 1) return SendClientMessage(playerid, -1, "Already have jetpack!"); //if the global variable JetPack is already 1, SendClientMessage will called and will send to the player who use the command, Remember -1 means COLOR_WHITE, some users say -1 is invalid color, they aren't.
JetPack[playerid] = 1; //Keep in mind set global variable JetPack to 1 before setting player special action to SPECIAL_ACTION_USEJETPACK to avoid the hack detection
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK); //will make player use jetpack
return 1;
}
i don't use strcmp but i think the code i mention above will work. try it yourself
Now its time to code our Anti-Jetpack Hack detection!
pawn Код:
public OnPlayerUpdate(playerid)
{
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) //will check if player is using Jetpack
{
if(JetPack[playerid] == 0) //if global variable JetPack is 0
{
//Your ban/kick/warn code here!
}
else //if global variable JetPack is 1
return 1; //will return 1;
}
else JetPack[playerid] = 0; //if player leaves the JetPack using Enter/F it will set the Global Variable JetPack to 0 again to avoid the problem in our command /jetpack
return 1;
}
It might be n00b for long time scripters but this is for beginners.
Good Luck building your Anti-Jetpack Hack!
Re: Detecting if player is Jetpack Hacking -
Kolten - 20.05.2012
looks good
rep+
Re: Detecting if player is Jetpack Hacking -
[FMJ]PowerSurge - 20.05.2012
Looks cool. You could edit your post saying it's just the base of one. You made it so everyone can use a jetpack but they get banned if they don't use a command for it, so maybe you could mention it'd be helpful to edit it in your own way :P
Re: Detecting if player is Jetpack Hacking -
JaKe Elite - 21.05.2012
Thanks, Kolten although you cannot rep yet, since only 50+ post can rep.
and thanks PowerSurge for Reputation although i don't need it.
Re: Detecting if player is Jetpack Hacking -
Derek_Westbrook - 21.05.2012
Mhmm nice 1 mate looks good rep for you
EDIT:I already gave you rep i forgot
Re: Detecting if player is Jetpack Hacking -
Roperr - 21.05.2012
Pretty simple and useful, good job, it'll help a lot of people
Re: Detecting if player is Jetpack Hacking -
kepa333 - 21.05.2012
ill test it
ty
Re: Detecting if player is Jetpack Hacking -
JaKe Elite - 21.05.2012
Quote:
Originally Posted by Derek_Westbrook
Mhmm nice 1 mate looks good rep for you
EDIT:I already gave you rep i forgot
|
Quote:
Originally Posted by Roperr
Pretty simple and useful, good job, it'll help a lot of people
|
Quote:
Originally Posted by kepa333
ill test it
ty
|
Thanks
Re: Detecting if player is Jetpack Hacking -
Deathlane - 08.12.2012
Easy, Nice, And Simple. I will use this, before, I used to place the kick code under OnPlayerUpdate, not thinking about the IsPlayerUsingJetpack[playerid] or whatever. This idea is great! +Rep.
Re: Detecting if player is Jetpack Hacking -
JaKe Elite - 08.12.2012
thanks