[Tutorial] Detecting if player is Jetpack Hacking
#1

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!
Reply
#2

looks good rep+
Reply
#3

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
Reply
#4

Thanks, Kolten although you cannot rep yet, since only 50+ post can rep.
and thanks PowerSurge for Reputation although i don't need it.
Reply
#5

Mhmm nice 1 mate looks good rep for you

EDIT:I already gave you rep i forgot
Reply
#6

Pretty simple and useful, good job, it'll help a lot of people
Reply
#7

ill test it
ty
Reply
#8

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
Reply
#9

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.
Reply
#10

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)