Jump to content

Anticheat script help


megaman54

Recommended Posts

Hi! I have made a anticheat that kicks players if they equip a minigun or something and if they enter a rhino.

But, i want this anticheat to ignore admins and moderators, how to do this? And in another script i found a function like isPlayerAdmin() is this function hardcoded? I dint found it at wiki :|

But anyway here is the anticheat script:

function illegalweapon ( previousWeaponID, currentWeaponID ) 
    if currentWeaponID == 38 or currentWeaponID == 35 or currentWeaponID == 36 then 
        local weapon = getWeaponNameFromID ( currentWeaponID ) 
        kickPlayer ( source, " AC detected ".. weapon) 
        outputChatBox("Cheater/Bug Abuser kicked!", getRootElement(), 255, 0, 0) 
        outputServerLog("ANTICHEAT: kicked abuser/cheater.") 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), illegalweapon ) 
  
function kickCheat ( theVehicle, seat, jacked ) 
    if ( getElementModel ( theVehicle ) == 432 ) then 
        kickPlayer ( source, " AntiCheat detected a Rhino. " ) 
    outputChatBox("Cheater/Bug Abuser kicked!", getRootElement(), 255, 0, 0) 
    outputServerLog("ANTICHEAT: kicked abuser/cheater.") 
    end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), kickCheat ) 
  

Link to comment
function illegalweapon ( previousWeaponID, currentWeaponID ) 
    if not isObjectInACLGroup (source, aclGetGroup ( "Admin" ) ) then 
    if currentWeaponID == 38 or currentWeaponID == 35 or currentWeaponID == 36 then 
        local weapon = getWeaponNameFromID ( currentWeaponID ) 
        kickPlayer ( source, " AC detected ".. weapon) 
        outputChatBox("Cheater/Bug Abuser kicked!", getRootElement(), 255, 0, 0) 
        outputServerLog("ANTICHEAT: kicked abuser/cheater.") 
    end 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), illegalweapon ) 
  
function kickCheat ( theVehicle, seat, jacked ) 
    if not isObjectInACLGroup (source, aclGetGroup ( "Admin" ) ) then 
    if ( getElementModel ( theVehicle ) == 432 ) then 
        kickPlayer ( source, " AntiCheat detected a Rhino. " ) 
    outputChatBox("Cheater/Bug Abuser kicked!", getRootElement(), 255, 0, 0) 
    outputServerLog("ANTICHEAT: kicked abuser/cheater.") 
    end 
    end 
end 

Edited by Guest
Link to comment
  • 8 months later...

you may use event onClientPlayerWeaponSwitch Instead of onPlayerWeaponSwitch

because onPlayerWeaponSwitch can't Discovery the weapons from Cheat Programs

i don't know if it now fixed or not but i was tested that from long ago

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...