24.11.2016, 14:42
(
Last edited by StrikerZ; 28/11/2016 at 01:08 AM.
)
(Removed)
new string[120],name[24];
GetPlayerName(i,name,sizeof(name));
format(string,sizeof(string),"[ANTI-CHEAT]: %s is speed hacking.",name);
new string[70]; // 70 is fine.
format(string, sizeof string, "[Anti-Cheat]: {FFFFFF}%s (%d) is speed hacking.", name);
GetPlayerHealth(i,health); GetPlayerArmour(i,armour); if(health >= 100)
#define GivePlayerMoney GivePlayerCash
public SendToAdmin(color,Message[]) { for(new i;i<MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { if(i != INVALID_PLAYER_ID && IsPlayerAdmin(i)) { SendClientMessage(i,color,Message); } } } return 1; }
GetPlayerHealth(i,health); GetPlayerArmour(i,armour); if(health >= 100) { new string[120],name[24]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"[ANTI-CHEAT]: %s is health-hacking. (Server health limit: 99) (Player's health: %d)",name,health); SendToAdmin(COLOR_RED,string); } if(armour >= 100) { new string[120],name[24]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"[ANTI-CHEAT]: %s is armour-hacking. (Server armour limit: 99) (Player's armour: %d)",name,armour); SendToAdmin(COLOR_RED,string); }
if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK) { new string[120],name[24]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"[ANTI-CHEAT]: %s is hacking jetpack.",name); SendToAdmin(COLOR_RED,string); }
if(Cash[i] != GetPlayerMoney(i)) { new string[120],name[24]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"[ANTI-CHEAT]: %s is hacking money.",name); SendToAdmin(COLOR_RED,string); }
if(GetVehicleSpeed(GetPlayerVehicleID(i)) > 1000) { new string[120],name[24]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"[ANTI-CHEAT]: %s is speed hacking.",name); SendToAdmin(COLOR_RED,string); }
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP)) { if(!IsPlayerInAnyVehicle(playerid)) { BunnyHop[playerid] += 1; SetTimer("TimerBunnyHop", 2000, false); new string[120],name[24]; GetPlayerName(playerid,name,sizeof(name)); format(string,sizeof(string),"[ANTI-CHEAT]: %s is bunny-hopping.",name); if(BunnyHop[playerid] >= 3) { SendToAdmin(COLOR_RED,string); } } } return 1; }
public OnPlayerDisconnect(playerid, reason) { return 1; }
if(IsPlayerConnected(i))
i != INVALID_PLAYER_ID
format(string,sizeof(string),"[ANTI-CHEAT]: %s is health-hacking. (Server health limit: 99) (Player's health: %d)",name,health);
SendToAdmin(COLOR_RED,string);
new bool:isAHacker[MAX_PLAYERS];
public OnPlayerConnect(playerid) {
isAHacker[playerid] = false;
}
if(isAHacker[playerid] == false)
//now check
isAHacker[playerid] = true;
#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
}
}
}
}
Why are you making an entire callback for SendToAdmin(color,Message[]); ?
Just create it as a function... |
You dont need both
pawn Code:
pawn Code:
|
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:
|
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 pawn Code:
pawn Code:
pawn Code:
|
He must use variables to count warnings. For every N number of warnings, a warning should be sent to the administrators. False detections happen often. |