Weapon detection
#5

I don't see what the problem with this code is, but a way to stop him from using it is to use the callback OnPlayerKeyStateChange

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
    new string[128], Ip[16], gun_name[30], day, month, year, query[200];
    if((newkeys & (KEY_FIRE) == KEY_FIRE) && (oldkeys & (KEY_FIRE) != KEY_FIRE)) {
        if(GetPlayerWeapon(playerid) >= 1 && GetPlayerWeapon(playerid) <= 45) {
            GetPlayerName(playerid, pname, sizeof(pname));
            GetPlayerIp(playerid, Ip, sizeof(Ip));
            GetWeaponName(GetPlayerWeapon(playerid), gun_name, sizeof(gun_name));
            format(string, sizeof(string), "Admin-Log: %s has been banned for weapon hack (Wep:%s)(%s).", pname, gun_name, Ip);
            SendAdminMessage(COLOR_RED, string);
            getdate(year, month, day);
            format(string, sizeof(string), "%02d/%02d/%d", day, month, year);
            format(query, sizeof(query), "INSERT INTO `player_ban` (`name` ,`banned_by` ,`time` , `date` ,`reason` ,`ip`) VALUES ('%s', 'Steve', %i, '%s', 'WEAPON HACK: %s', '%s')", pname, gettime(), string, gun_name, Ip);
            mysql_query(query);
            SendClientMessage(i, COLOR_GREY, "You are banned from this server for 'weapon hacking'.");
            TogglePlayerControllable(playerid,0);
            Kick(playerid);
        }
    }
}
Reply


Messages In This Thread
Weapon detection - by Bogdan1992 - 01.05.2012, 13:11
Re: Weapon detection - by Bogdan1992 - 01.05.2012, 13:19
Re: Weapon detection - by MP2 - 01.05.2012, 13:23
Re: Weapon detection - by Bogdan1992 - 01.05.2012, 13:25
Re: Weapon detection - by Pinguinn - 01.05.2012, 13:37
Re: Weapon detection - by Bogdan1992 - 01.05.2012, 13:48
Re: Weapon detection - by Vince - 01.05.2012, 14:43

Forum Jump:


Users browsing this thread: 1 Guest(s)