31.12.2016, 13:49
Nice !
ac_fpublic ac_AntiCheatGetAnimationIndex(playerid) return ACInfo[playerid][acAnim];
ac_fpublic ac_AntiCheatGetDialog(playerid) return ACInfo[playerid][acDialog];
ac_fpublic ac_AntiCheatGetMoney(playerid) return ACInfo[playerid][acMoney];
ac_fpublic ac_AntiCheatGetClass(playerid) return ACInfo[playerid][acClassid];
ac_fpublic ac_AntiCheatGetEnterVehicle(playerid) return ACInfo[playerid][acEnterVeh];
If your code can get all variables via API I can implement shoebill function to fill your parameters.
In other words, every time when you are going to hook any event you should take data not from enum directly but from function (you have almost done this as far as I see). And add this data getters into a separate file, so I can overwrite it. |
There is an issue with textdraw in the latest version of anti-cheat.
I can't select my menu |
What functions are still causing problems and what functions also would be necessary to rewrite?
For now I find good solution for me. I use only physical calculation on NEX-AC side, and controll all flags on the shoebill side. So problem is closed. Sorry for disturbing and thank you for your support So I checked it with my dialogs that use textdraws (video) As you can see it works. At the end I was flooding in order to show that anticheat is connected and all anti-cheat codes are enabled |
public OnCheatDetected(playerid, ip_address[], type, code)
Called when the tripped one of the anti-cheats
playerid - ID of the cheater
ip_address[] - IP-address of the cheater
type - Type of cheating (when 0 it returns the ID, when 1 - IP)
code - Code (ID) of the anti-cheat
PHP код:
plz show me an example ?? |
forward OnCheatDetected(playerid, ip_address[], type, code);
public OnCheatDetected(playerid, ip_address[], type, code)
{
if(type) BlockIpAddress(ip_address, 0); //Responded to IP (for example for rcon brute) - block him
else //Responded to the player ID
{
switch(code) //What cheat code?
{
case 5: return 1; //Teleport unoccupied cars (ac in any case will return it to its original pos, the punishment shouldn't do)
case 11: //Repair car, it is better to return the old hp (if cheater will not set old hp - anti-nop will detect him)
{
new vehid = GetPlayerVehicleID(playerid), Float:vhealth;
AntiCheatGetVehicleHealth(vehid, vhealth);
SetVehicleHealth(vehid, vhealth);
return 1;
}
case 14: //Money
{
//Here is your code
/*
//Return the old money
new a = AntiCheatGetMoney(playerid);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, a);
return 1; //We don't need another punishment
*/
}
case 32: return ClearAnimations(playerid, 1); //CarJack, remove player from vehicle
case 40: SendClientMessage(playerid, -1, MAX_CONNECTS_MSG); //Sandbox (connect 2 or more people from the same IP), say goodbye
case 41: SendClientMessage(playerid, -1, UNKNOWN_CLIENT_MSG); //Unknown client version, say goodbye to him
case 43..47: //Crashers
{
Kick(playerid); //It is HIGHLY recommended to kick without delay, otherwise IT will have time to crash players
return 1;
}
default: //All others cheats
{
static strtmp[sizeof KICK_MSG];
format(strtmp, sizeof strtmp, KICK_MSG, code); //Another way to say goodbye
SendClientMessage(playerid, -1, strtmp);
}
}
new pPing = GetPlayerPing(playerid) + 150;
SetTimerEx("ac_KickTimer", (pPing > 500 ? 500 : pPing), false, "i", playerid); //ac_KickTimer is already in anticheat and successfully will be called
}
return 1;
}
PHP код:
|
GivePlayerMoney(playerid, a); return 1; //We don't need another punishment
default: //All others cheats { static strtmp[sizeof KICK_MSG]; format(strtmp, sizeof strtmp, KICK_MSG, code); //Another way to say goodbye SendClientMessage(playerid, -1, strtmp); } |
When PLAYER1 is spectating PLAYER2 and PLAYER2 gets kicked for whatever reason (in this case hacks) then PLAYER1 will be kicked out of the server (this line reacts even anticheats are off);
How can I fix that? |
case 21: return 1; //Unless, of course, triggered exactly code 21?
If you are using in your gm public OnCheatDetected, you can add to switch the following case:
PHP код:
|
Thanks this helped. Also if player takes guns from pickup in server he/she gets kicked, can I turn off all the 'anticheats' for specific period of time, what should I do to prevent kicking player for taking guns from pickup? Players for taking guns using a pickup are kicked with "add ammo" anticheat.
Also innocent players are kicked for NOP even though they are not cheating; when player enter a vehicle and then leaves (not always, sometimes). Also if you are using shotgun and switch to AK or M4 and shoot (with a short period of time) you will be punished for rapid. So, how do I give weapons in order not to be kicked? I am using GetPlayerWeaponEx now. |