IF(GetPlayerVar($userName,OnTrack) == 1)
THEN
#Player on track
ELSE
#Player NOT on Track
ENDIF
CASE "!pm":
IF( $argv != "" ) THEN
$idxSpace = indexOf( $argv, " ");
IF( $idxSpace != -1 ) THEN
$User = subStr( $argv,0,$idxSpace );
#Check if Player is online on the server.
$currPly = getPlayerInfo($User);
IF( $currPly != "" ) THEN
$Message = trim( subStr( $argv,$idxSpace ) );
privMsg( $User , "^1[PM] ^7". $userName . " ^0>> ^3" . $Message);
privMsg("^1[Private Message] ^7". $User . " ^0>> ^3" . $Message);
ELSE
privMsg ( "^7Player does not exist");
ENDIF
ELSE
privMsg ( "^7Incomplete command: !pm <username> <Message>" );
ENDIF
ELSE
privMsg ( "^7Incomplete command: !pm <username> <Message>" );
ENDIF
BREAK;
Soundoption for globalmsg(); / privmsg();
NOTE: is compatible with older scripts.
0 = No Sound
1 = Message Sound
2 = SystemMessage Sound
3 = InvalidKey Sound
4 = ERROR Sound
5 = NUM Sound
-Possible options for globalmsg() :
globalmsg("BLAHBLAH");
globalmsg("BLAHBLAH",0);
-Possible options for privmsg() :
privmsg("BLAHBLAH");
privmsg("BLAHBLAH",0);
privmsg($userName,"BLAHBLAH");
privmsg($userName,"BLAHBLAH",0);
IF($argv != "") THEN
#Getlistofplayers
$ListOfPlayers = GetListOfPlayers();
FOREACH ($Player in $ListOfPlayers)
$User = $Player["value"];
###Send message if a user is an admin
IF( UserisAdmin($User) == 1 )THEN
privmsg($User,"-----------------------------------");
privmsg($User,$userName." send a adminmessage");
privmsg($User,$argv);
privmsg($User,"-----------------------------------");
ENDIF
ENDFOREACH
ELSE
privmsg("Message not detected, correct syntax: !a <message>");
ENDIF
BREAK;
$ListOfPlayersDiscordEmbed = "";
$LoP = GetListOfPlayers("U");
FOREACH ($Player IN $LoP)
$UserName = $Player["value"];
$NickName = GetPlayerVar($UserName,"NickName");
$NickUserNameString = "".StripLFSColor($NickName)."(".$UserName.")";
###Create a new line after each $NickUserNameString has been added to $ListOfPlayersDiscordEmbed
$ListOfPlayersDiscordEmbed = $ListOfPlayersDiscordEmbed."".$NickUserNameString." \n";
ENDFOREACH
$DiscordChannel = "";
$Title = "";
$Desc = "";
$Color = "0xFFFFFF";
$FieldTitle = "List Of Players:";
$FieldValue = "".$ListOfPlayersDiscordEmbed."";
$FieldInline = "True";
$Footer = "";
$ThumbnailUrl = "";
$ImageUrl = "";
SendDiscordEmbed($DiscordChannel,$Title,$Desc,$Color,$FieldTitle,$FieldValue,$FieldInline,$Footer,$ThumbnailUrl,$ImageUrl);
$GetDistanceInMeters = trackuserdistance($userNameOne, $userNameTwo);
$GetAngleInDegrees = GetAngle($userNameOne,$userNameTwo);