First things first...
1) If you messageAll('',"%client.player.getDatablock()");, you'll get a chat message saying the underlined. This I know.
2) If you messageAll('',%client.player.getDatablock()); instead, you'll get a chat message saying the value of the underlined. This I also know.
Now with this script...
package ExeChat {
function serverCmdMessageSent(%client,%msg) {
if(getSubStr(%msg, 0, 3) $= "#=#") {
%msg = strReplace(%msg,"#=#","");
messageAll('',%client.name @ ": " @ %msg);
}
else {
Parent::serverCmdMessageSent(%client,%msg);
}
}
};
activatePackage(ExeChat);
...I'd like it to display the value of %msg, not %msg itself, when you type "#=#" first.
Since it's a string entered by the user, I have no idea what to do.
To clarify:
Right now the script works as this:
- *Player types in "#=#findclientbyname(Truce).bl_id"*
- A chat message appears saying "Truce: findclientbyname(Truce).bl_id"
What it should be doing:
- *Player types in "#=#findclientbyname(Truce).bl_id"*
- A chat message appears saying "Truce: 3808"
Does anyone know a way to solve this?
Thanks in advance.