Jump to content

[HELP] How to know if a player passed map limit?


Cacaroto

Recommended Posts

Okay, so would be done just checking if a player passes from -3000 or +3000 with getElementPosition?

CLIENT

function checkIfPlayerPassedLimit()
    local x, y, z = getElementPosition(getLocalPlayer())
    if x > 3000 or -3000 or y > 3000 or -3000 or z > 3000 or -3000 then
        local pName = getPlayerName(getLocalPlayer())
        triggerServerEvent ( "onLimitPass", resourceRoot, pName)
    end
end

 

SERVER

function greetingHandler (pName)
    outputChatBox( pName.." has passed map limit.", getRootElement(), 255, 255, 255, trues )
end
addEvent( "onLimitPass", true )
addEventHandler( "onLimitPass", resourceRoot, greetingHandler )

 

Edited by Cacaroto
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...