![]() |
clientr strings?
Let's see, I've had a quite annoying problem, sometimes I can't read clientr. strings serverside, some cleintr strings are readable, and some are not.
Here's some examples of my problem: PHP Code:
PHP Code:
PHP Code:
the clientr string is setted serverside in a class.. Well, any thoughts? |
The *.mud* strings are protected, they are reserved for GK. Better use md_ for example.
|
Quote:
|
Quote:
I've come to use PHP Code:
|
Quote:
but I changed the start of the string (it was .mud_), and now it works quite fine.. dunno why.. might be with what contiga said :) |
Quote:
|
Quote:
|
I don't think mud_ strings are sent to the client.
|
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). |
Quote:
example of how I did it: +Initialize PHP Code:
PHP Code:
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? |
Better let the player join the class directly at login, in the control-npc in onActionPlayerOnline() or by using the event onPlayerLogin(playerobject) in any other script. In your example it would call the thing several times and would still not guarantee that its working. Also use this.clientr.flagname in the initialize class instead of clientr.flagname.
|
Quote:
it always echo up to 2-3 times, so.. I'll set it with this.client.flagname when setting it, and join on logon. I'll try that :] Btw, onPlayerLogin() works in every wnpcs (serverside) ? And onActionPlayerLogin() would work in al dnpcs? |
onActionPlayerOnline(): for the Control-NPC only
onPlayerLogin(playerobject): for all server-side npcs (including weapon-npcs), do playerobject.join() etc. instead of player.join() |
Quote:
btw, do onActionPlayerOnline() return any objects/params? |
I don't think, it's just an parameter-less event like onPlayerChats and similar
|
Quote:
Now I just need to figure out something else (related to loadvars and such) |
| All times are GMT +2. The time now is 05:12 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.