OnDisconnect
#1
Aside from no documentation on how to use this. I can't get it to fire when a player leaves. The only example I found was in the Area plugin. From that I've made my own function for my upcoming plugin (Note: I removed everything inside the function for clarity and readability.)

Code:
function ZonePlugin:OnDisconnect(Reason, Player)

return false
end

Is this correct? If so, is it suppose to fire every time a player leaves? Because It doesn't. I put debug logging lines in and they don't appear. Functions are never called when they are inside. Please help as this is a very important part for databasing and clearing unwanted variables!
Reply
Thanks given by:
#2
Did you tell the plugin manager to call that function on your plugin? Also check the MagicCarpet plugin because it uses on disconnect to remove the carpet
Reply
Thanks given by:
#3
Yeah, I ended up figuring that out eventually. Why does missing tiny details always make you feel like a big idiot? Thanks.

Aside from everything now working normally and as intented, I noticed the server crashes when you reload plugins from in game when requiring luasql.sqlite3. Also is there currently any way of either creating new entities or copying them, specifically the Player? I'd be nice to make a NPC plugin for use with an RP server.
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)