View Single Post
  #12  
Old 07-27-2012, 03:17 AM
Imperialistic Imperialistic is offline
graal player lord
Imperialistic's Avatar
Join Date: Apr 2007
Location: Florida
Posts: 1,094
Imperialistic is a jewel in the roughImperialistic is a jewel in the rough
Quote:
Originally Posted by cbk1994 View Post
PHP Code:
function onActionServerSide(cmdtargetmsg) {
  if (
cmd == "tell") {
    
temp.pl findPlayerByCommunityName(target);
    
    if (
pl == null) {
      return 
player.chat "(player not found)";
    }
    
    
pl.triggerClient("gui"this.name"tell"player.communitynamemsg);
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("tell")) { // format is: tell account "message here"
    
temp.tokens player.chat.tokenize();
    
    
temp.acc tokens[1];
    
temp.msg tokens[2];
    
    
triggerServer("gui"this.name"tell"accmsg);
  }
}

function 
onActionClientSide(cmdsendermsg) {
  if (
cmd == "tell") {
    
player.chat sender ": " msg;
  }

To use this you would say: tell cbk1994 "Hi there ugly!"
Instead of creating a new thread I'm just going to bump this, sowwwy.

I have been trying to sharpen my scripting skills lately and I ran into a problem with this.. The script works fine and everything but I don't understand why we have to put the quotation marks around the "message" or else it wont register. I believe there is another way to read the player chat but I'm unsure of it.
__________________
" It's been swell, but the swelling's gone down. "
Reply With Quote