Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Serverside substring (https://forums.graalonline.com/forums/showthread.php?t=134264503)

furry_mougle 09-08-2011 02:41 AM

Serverside substring
 
how would I pass temp.tag serverside? it only registers clientside

edit: mark got it

PHP Code:

function onActionServerSide(cmd) {
  if (
cmd == "tag") {
    
player.guild temp.tag;
  }
  if (
cmd == "emptytag"){
    
player.guild "";
  }
}

//#CLIENTSIDE

function onPlayerChats(){
temp.tag player.chat.substring("/tag ".length());
  if (
player.chat.starts("/tag ") && player.guild == "" ) {
    
triggerserver("gui",this.name,"tag"); // triggers params tag and sets player guild
    
player.chat "Tag set to: " temp.tag;
  } else if(
player.chat == "/tag" && player.guild != "" ){
    
triggerserver("gui",this.name,"emptytag");
    
player.chat "";
  }



Mark Sir Link 09-08-2011 02:46 AM

need to send the tag to be set to as a parameter in your triggerserver.

triggerserver("gui", this.name, "tag", temp.tag);

then in the serverside, either define another param in the function definition
function onActionServerside(cmd, tag)

or change player.guild = temp.tag to
player.guild = params[1];

furry_mougle 09-08-2011 02:53 AM

thanks markus! didn't even think of that dog!


All times are GMT +2. The time now is 08:34 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.