Posts: 261
Threads: 32
Joined: Dec 2018
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?
Posts: 12
Threads: 2
Joined: Mar 2015
Reputation:
0
How do you detect the player removing their jetpack?
Posts: 261
Threads: 32
Joined: Dec 2018
I don't, because i don't know how to do it.
Posts: 1,092
Threads: 4
Joined: Jun 2012
Reputation:
0
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.
Posts: 261
Threads: 32
Joined: Dec 2018
Can you give me an example on how to do the first solution? Seems more simple and faster.
Posts: 261
Threads: 32
Joined: Dec 2018
Quote:
Originally Posted by Kaliber
Just something like this:
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_SECONDARY_ATTACK) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z),SetPlayerPos(playerid, X, Y, Z);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
}
return 1;
}
|
Ok but where do i place the ServerJetpack bool to check it?
Quote:
Originally Posted by Florin48
solved?
|
Not yet.
Posts: 259
Threads: 2
Joined: Nov 2015
Reputation:
0
you could make Jetpack for as long as you want and when it's time to get jetpack gets kicked.