0 Members and 1 Guest are viewing this topic.
Question about that since I've only used this once and had no need to get specifics from it, "string reason - Reason for disconnecting", how is this stored? Can I just access it like Code: Lua gameevent.Listen( "player_disconnect" )hook.Add( "player_disconnect", "player_disconnect_example", function( data ) local reason = data.reason if reason == "Disconnect by user." then -- The things I want it to do endend )or is there some other way to do it, or do you not know?
"self", "kick", "ban", "cheat", "error"
Just do some debug printing.Print data.reason and have a player leave in the way you're looking for and you'll see exactly what it returns and what you should check for.