mirror of
https://github.com/BeamMP/Docs.git
synced 2025-07-01 23:45:46 +00:00
add: ability to reject auth with reason
onPlayerAuth can be rejected with a reason string
This commit is contained in:
parent
b943ee6192
commit
63d0ac6fac
@ -909,7 +909,14 @@ Triggered when the server shuts down. Currently happens after all players were k
|
|||||||
Arguments: `player_name: string`, `player_role: string`, `is_guest: bool`, `identifiers: table -> beammp, ip`
|
Arguments: `player_name: string`, `player_role: string`, `is_guest: bool`, `identifiers: table -> beammp, ip`
|
||||||
Cancellable: YES
|
Cancellable: YES
|
||||||
|
|
||||||
First event that gets triggered when a player wants to join.
|
First event that gets triggered when a player wants to join. A player can be denied from joining by returning `1` or a reason (`string`) from the handler function.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
function myPlayerAuthorizer(name, role, is_guest, identifiers)
|
||||||
|
return "Sorry, you cannot join at this time."
|
||||||
|
end
|
||||||
|
MP.RegisterEvent("onPlayerAuth", "myPlayerAuthorizer")
|
||||||
|
```
|
||||||
|
|
||||||
##### `onPlayerConnecting`
|
##### `onPlayerConnecting`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user