25.11.2016, 01:54
Why are you making an entire callback for SendToAdmin(color,Message[]); ?
Just create it as a function...
You dont need both
and
Just use the != INVALID_PLAYER_ID
Also, since I see that you are using the basic method for GetPlayerHeath to detect if they have over 100 hp etc. Do something about this
Because if someone gets detected as a hacker, this will send like 4 messages a second since you dont have a check to see if he was already confirmed a hacker or not
You could just do something like
And then when you want to check if he is a hacking or not, check if he was already marked as a hacker
and when you want to set him as a hacker?
Also regarding the vehicle speed, get a jet, and see how fast you can go, also try falling and also see whats the max speed you get I think that 1000.00 km/h is too much, try doing some tests and see what is natural & what un-natural
Also instead of using a timer for anti b-hop use timestamps
Example code for anti b-hop (untested & not compiled, just as an example)
All in all, considering its your 4th time making a release, please be more prepared when you make releases. Also I'd highly recommend switch to github so others can contribute to your code & make it better.
EDIT: Also for the bunnyhop, check player animation. When I was creating my own anti bunnyhop system I had a lot of problems by just simply checking how many times they pressed jump button. Make sure you check their animation when they press enter since imagine you just press space few times fast (you would actually just jump once) it will detect you as a bunnyhopper
Just create it as a function...
You dont need both
pawn Code:
if(IsPlayerConnected(i))
pawn Code:
i != INVALID_PLAYER_ID
Also, since I see that you are using the basic method for GetPlayerHeath to detect if they have over 100 hp etc. Do something about this
pawn Code:
format(string,sizeof(string),"[ANTI-CHEAT]: %s is health-hacking. (Server health limit: 99) (Player's health: %d)",name,health);
SendToAdmin(COLOR_RED,string);
You could just do something like
pawn Code:
new bool:isAHacker[MAX_PLAYERS];
public OnPlayerConnect(playerid) {
isAHacker[playerid] = false;
}
pawn Code:
if(isAHacker[playerid] == false)
//now check
pawn Code:
isAHacker[playerid] = true;
Also instead of using a timer for anti b-hop use timestamps
Example code for anti b-hop (untested & not compiled, just as an example)
pawn Code:
#define MAX_JUMPS 3 //maximum 3 jumps before we report him as a bunnyhopper
#define JUMPS_EXPIRE 5 //jumps will expire after 5 seconds
new timePassed[MAX_PLAYERS],
playerJumps[MAX_PLAYERS];
if((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP)) {
if(!IsPlayerInAnyVehicle(playerid)) {
if(gettime() > timePassed[playerid]) {
playerJumps[playerid] = 0; //reseting their jumps if 5 seconds passed
timePassed[playerid] = gettime()+JUMPS_EXPIRE;
playerJumps[playerid] += 1;
}
else { //if 5 seconds didnt pass
playerJumps[playerid] += 1;
if(playerJumps[playerid] >= MAX_JUMPS) { //if they jumpped more than 3 times in less than 5 seconds
Kick(playerid); //kick them or something
}
}
}
}
All in all, considering its your 4th time making a release, please be more prepared when you make releases. Also I'd highly recommend switch to github so others can contribute to your code & make it better.
EDIT: Also for the bunnyhop, check player animation. When I was creating my own anti bunnyhop system I had a lot of problems by just simply checking how many times they pressed jump button. Make sure you check their animation when they press enter since imagine you just press space few times fast (you would actually just jump once) it will detect you as a bunnyhopper