Native referenceFiveMserver

DOES_PLAYER_EXIST

0x12038599 CFX
FUNCTION SIGNATURE
BOOL DOES_PLAYER_EXIST(char* playerSrc);
Property Value
Native Name DOES_PLAYER_EXIST
Hash 0x12038599
Return Type BOOL
API Set server
Parameters playerSrc (char*)

Description: Returns whether or not the player exists

Examples

local deferralMessages = { "Isn't this just magical!", "We can defer all day!", "You'll get in eventually", "You're totally not going to sit here forever", "The Fruit Tree is a lie" }
AddEventHandler("playerConnecting", function(name, setKickReason, deferrals)
    local source = source
    deferrals.defer()

    Wait(0)


    local messageIndex = 0

    repeat
        Wait(2000)
        if messageIndex >= #deferralMessages then
            deferrals.done()
        else
            messageIndex = messageIndex + 1
        end
        deferrals.update(deferralMessages[messageIndex])
    until not DoesPlayerExist(source)
end)
Back to CFX