Hey all, I was wondering if it's possible to disable the normal join/quit messages of the server and replace them with my own. Also, I have a script ready for this, but it give me an error that I don't quite understand:
//This function is executed when a player leaves.
function onPlayerPart(thePlayer, reason)
{
local reasonString = "Unknown";
if(reason == PARTREASON_DISCONNECTED) { reasonString = "Quit"; }
if(reason == PARTREASON_TIMEOUT) { reasonString = "Timeout"; }
if(reason == PARTREASON_BAN) { reasonString = "Banned"; }
if(reason == PARTREASON_KICKED) { reasonString = "Kicked"; }
MessageAllExcept("* "+thePlayer.Name+" has left the game ("+reasonString+").", thePlayer, 0, 255, 0);
}
CONNECTION: Closed [192.168.1.45] | Index [0]
AN ERROR HAS OCCURED [getVarInfo: Could not retrieve UserData]
CALLSTACK
*FUNCTION [onPlayerPart()] Scripts/Main/sJohnMode.nut line [57]
LOCALS
[reasonString] "Quit"
[reason] 0
[thePlayer] INSTANCE
[this] TABLE
CONNECTION: Incoming [192.168.1.45] | Index [0]
Thanks in advance.