Okay guys,
Here's the base code that I will be using, wrapped in a !pm command for you.
Add this code in the LFSLapper.lpr file in amongst the other ! commands:
<?php
CASE "!pm":
$idxSpace = indexOf( $argv, " ");
$toUser = subStr( $argv,0,$idxSpace );
$argv = trim( subStr( $argv,$idxSpace ) );
userMsg (GetCurrentPlayerVar( "Nickname" ), $toUser, $argv);
BREAK;
?>
Add this code to the parseEvent.cs file just above the code for the "privmsg" command:
<?php
case "usermsg":
{
testArgs(ident, "SSS", args);
currInfoPlayer = listOfPlayers.getPlayerByUserName((string)args[1]);
if (currInfoPlayer == null)
throw new GLScript.GLApp.GLScriptException("You can't use " + ident + " in this context, not a player event");
string text = args[2].ToString();
if (text == "[[TranslateEngine]]")
text = lfsLang.replaceParmsLangStr(currInfoPlayer.idLang);
SendMsgToConnection(currInfoPlayer.UCID, "^6Personal msg from: ^8" + (string)args[0]);
SendMsgToConnection(currInfoPlayer.UCID, "^7" + text );
break;
}
?>
Use by typing in a normal text window:
!pm krayy hey there matey
Note: To use the code, you need to address it using the username, not the nickname. This won't matter when I make it a button off of the !who display