Hello. I record the distances traveled by the players on the server, and when they leave the server, I wanted it to be sent to the discord channel as a log. But it didn't work. This code works in the onleaverace function but not in the ondisconnect section.
When I tried it in Lapper, I got an error like this. What should I do in this situation.
5/8/2024 3:23:52 PM -> Syntax error: in file ".\default\LFSLapper.lpr" at line #1099
You can't use GetCurrentPlayerVar in this context, not a player event
Function 'ondisconnect' script aborted
Finally. I tried to send users their times in a txt file, but I failed. Is it possible to send this on discord?
When I tried it in Lapper, I got an error like this. What should I do in this situation.
5/8/2024 3:23:52 PM -> Syntax error: in file ".\default\LFSLapper.lpr" at line #1099
You can't use GetCurrentPlayerVar in this context, not a player event
Function 'ondisconnect' script aborted
CatchEvent OnDisConnect( $userName, $reason ) # Player event
$Message = " " .$userName. " ** Sunucudan ayrılmadan önce ki bağlantı süresi >> ** (". GetCurrentPlayerVar("ConnectedTime")." )"; $DiscordChannel = "1237545908024119297"; sendmessagetodiscord($DiscordChannel,$Message);
EndCatchEvent
Finally. I tried to send users their times in a txt file, but I failed. Is it possible to send this on discord?