Hello, any idea how to make this small piece of code to work?
Also, I’ve seen GetConvarInt in Lua and no idea how would I want to use it in C#, I haven’t found any documention about this command and what does it even do.
I’ve tried CallbackDelegate but that was just a random code which doesn’t work apparently. Thanks!
Thanks to @Damien on the fivem discord I got it working.
You should use this instead Action<Player, string, CallbackDelegate>, the Player is well for your player, the string is for the player’s name and the CallbackDelegate acts as a function. As written on the wiki (https://wiki.fivem.net/wiki/Event:PlayerConnecting) the event in Lua takes 3 parameters :
source: The player identifier of the connecting player. (implicit global)
playerName: The name of the connecting player.
setKickReason: A function that can be used to set a custom reason when canceling the event.
So I guess every time there’s a Lua function it requires to be called in a CallbackDelegate, you were just missing the Player argument, that’s just a reference for people encountering the issue!