View Single Post
  #10  
Old 12-09-2006, 04:24 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Stefan View Post
clientr.mud_ strings are just not saved and not accepted by the npcserver (you cannot set them with RC as far as I know), but they should work fine.

I guess the problem of the original poster lies in the placement of the code, it would be interesting to know in what class/object that onCreated() function is put. When it is an npc, then it is normal that there is no player. object. If the player has joined a class and onCreated() is placed in that class, then it is better to use "this.clientr...". The code in the original post should still work in that case though, it might not be called at all though if the player already joined some other class before and is so not "created" a second time (onCreated() is only called when the script object is initialized).
Hmm, I setted the strings inside a class, serverside (player.join())

example of how I did it:

+Initialize
PHP Code:

player
.join"initialize");

function 
onActionServerside() {
  switch( 
params0]) {
    case 
"init":
      
player.mud_initialize();
    break;
  }
}

//#CLIENTSIDE
function onCreated() {
  
onPlayerEnters();
}

function 
onPlayerEnters() {
  if ( !( 
clientr.mud_player_joined)) {
    
triggerserver"gui""+Initialize""init");
  }

class: initialize
PHP Code:

public function mud_initialize() {
  
// setting of strings here
  
clientr.mud_player_joined true;

When player logs on, and clientr.mud_player_joined is false,
it triggers and do a player join on serverside, inside the class
the strings are setted.. Is this method correct, or should I use an other way?
__________________

Last edited by Chompy; 12-09-2006 at 04:43 PM..
Reply With Quote