Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   changing player.nick, player.guild,.. (https://forums.graalonline.com/forums/showthread.php?t=134262275)

callimuc 03-01-2011 10:48 PM

changing player.nick, player.guild,..
 
Hey guys. I´m trying something which i might also post in code gallery if it´s finished :D. But currently i got a fail. I want like when I press the gui button, that it will change the player.guild,... but it wont work. Script here :

PHP Code:

function onActionServerSide() {
  if (
params[0] == "test") {
    
player.nick = login_nickname1.text;
    
player.guild = login_nickname2.text;
  }
}
//#CLIENTSIDE
//gui stuff
function button1.onAction() {
  
triggerserver("gui",this.name,"test");
} 

-callimuc

DustyPorViva 03-01-2011 10:52 PM

PHP Code:

function onActionServerSide() {
  if (
params[0] == "test") {
    
player.nick = params[1];
    
player.guild = params[2];
  }
}
//#CLIENTSIDE
//gui stuff
function button1.onAction() {
  
triggerserver("gui",this.name,"test",login_nickname1.text,login_nickname2.text);
} 

GUI controls are clientside, so you can't access their data from the server, thus you pass them in parameters.

cbk1994 03-01-2011 10:53 PM

Make sure to follow the advice in this thread as well.

callimuc 03-02-2011 12:06 AM

Oh ok thx. I'm currently on iPod here, and my gold will end tonight so I'll try it out when I'm upgraded again ^^


All times are GMT +2. The time now is 06:05 PM.

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