anit cheat
#1

Well, I made a basic anti cheat, just for forbidden weapons (minigun, rocket launcher, heat seeking etc..)
And it kicks me if I'm shooting with ANY weapon for somereason.
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if ((
newkeys KEY_FIRE) && !(oldkeys KEY_FIRE))
    {
        if(
GetPlayerWeapon(playerid) == 38 || || 18 || 35 || 36 || 37)
        {
            new 
string[128];
            
format(stringsizeof(string), "AdmCmd: %s was kicked by the server's anti-cheat, reason: Weapon hacks"GetName(playerid));
            
SendClientMessageToAll(COLOR_SYSTEMstring);
            
Kick(playerid);
        }
    }
    return 
1;

Reply
#2

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
    {
        new w = GetPlayerWeapon(playerid);
        if(w == 9 || w == 18 || (w > 34 && w < 39))
        {
            new string[128];
            format(string, sizeof(string), "AdmCmd: %s was kicked by the server's anti-cheat, reason: Weapon hacks", GetName(playerid));
            SendClientMessageToAll(COLOR_SYSTEM, string);
            Kick(playerid);
        }
    }
    return 1;
}
Reply
#3

pawn Код:
GetPlayerWeapon(playerid) == 38 || GetPlayerWeapon(playerid) == 9 || GetPlayerWeapon(playerid) == 18 || GetPlayerWeapon(playerid) == 35 || GetPlayerWeapon(playerid) == 36 || GetPlayerWeapon(playerid) == 37
Edit: The guy above me has a better code and was faster.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)