Jump to content

I'm doing an anti cheat


Recommended Posts

Posted

I'm doing an anti cheat and have some doubts

the former is:

this is correct?

function checklife(player) 
    local playerHealth = getElementHealth(player) 
    setTimer (checklife, 2000, 0) 
    if playerHealth >= 102 then 
        local theNoob = getPlayerFromName(player) 
        local theNoobSerial = getPlayerSerial(theNoob) 
        addBan( nil, nil, theNoobSerial, player, "Hacker Detectado! LIXAO!" ) 
    end 
end 
addEventHandler( "onPlayerSpawn", getRootElement(), checklife ) 

Posted

See the parameters of onPlayerSpawn event. Use the source instead parameter player.

The source of this event is the player that just spawned.

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...