Anti jetpack
#1

So, i made a little anti jetpack system where players if spawn a jetpack they'll be banned.

I've added a bool:

ServerJetpack.

Where i set to true if i give manually a jetpack to player with SetPlayerSpecialAction.

The sistem works, if i give manually a jetpack to a player, they don't get banned, BUT.

If they remove their manually given jetpack and they get it again, they'll be banned.

How to avoid this?
Reply
#2

How do you detect the player removing their jetpack?
Reply
#3

I don't, because i don't know how to do it.
Reply
#4

Actually you have 2 simple solutions:

1. You could simple remove the jetpack completly, if he presses return. (so he cant get it on again)

2. You check if he gets a new jetpack, and if its in the range of the old position..it is okay again.
Reply
#5

Can you give me an example on how to do the first solution? Seems more simple and faster.
Reply
#6

Just something like this:

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys

    if ((
newkeys KEY_SECONDARY_ATTACK) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK
    { 
        new 
Float:XFloat:YFloat:Z;  
        
GetPlayerPos(playeridXYZ),SetPlayerPos(playeridXYZ);  
        
SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE);
    } 
    return 
1

Reply
#7

solved?
Reply
#8

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Just something like this:

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys

    if ((
newkeys KEY_SECONDARY_ATTACK) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK
    { 
        new 
Float:XFloat:YFloat:Z;  
        
GetPlayerPos(playeridXYZ),SetPlayerPos(playeridXYZ);  
        
SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE);
    } 
    return 
1

Ok but where do i place the ServerJetpack bool to check it?

Quote:
Originally Posted by Florin48
Посмотреть сообщение
solved?
Not yet.
Reply
#9

Quote:

Ok but where do i place the ServerJetpack bool to check it?

You can set it there to false, because there he will loose the jetpack.
Reply
#10

you could make Jetpack for as long as you want and when it's time to get jetpack gets kicked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)