Wiki

Clone wiki

EFLC-MP LUA / onPlayerConnect

Description

Triggered when the player connection request arrives. At this stage only their ID and IP are available. spawnPlayer cannot be used here.

Parameters

Int playerId
Int playerId

Return values

Bool allowConnection
Return True to allow the player connection or False to disconnect them.

Example

#!lua
function myPlayerConnectFunction(playerid)
    if(getPlayerIp(playerid) == "some banned ip") then
        return false
    end
    return true
end

Updated