add: ability to reject auth with reason

onPlayerAuth can be rejected with a reason string
This commit is contained in:
carsakiller 2024-09-21 10:14:15 -04:00 committed by O1LER
parent b943ee6192
commit 63d0ac6fac

View File

@ -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`
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`