![]() |
Player's Client Variable
Can a Player's client variable be accessed when they are offline?
They should be? Cause in RC you can /open accountname and see their attributes and even change them while they are offline. |
I think it's possible to give your NPC-Server read rights to files from the accounts/ folder, however, some argue that it's not recommended since it can easily be abused.
|
Quote:
What you may want to do is save the player (player.saveVars()) when the player logs out, and (player.loadVars) when they log in. This lets you back things up, as well as be able to edit offline and have it be changed when they get back online. |
Quote:
|
Quote:
|
@cbkbud: How would you check if a player went online/offline?
@Tigarius: Nothing really for future reference. I just made a stupid mistake I overlooked. The ones that others solved for me are still alive and well. |
Quote:
PHP Code:
|
kool thx
|
NPC Code:params[3].loadVars( "control/players/" @ params[3] @ ".txt" ); This is to set a player's client.guildrank. It won't save though.. anyone know why? |
Possibly the NPC-Server doesn't have rights?
Also is params[3] actually the player? |
Yeah I tested it with echo and it showed my account name
and npc server does have rights : rw control/*.txt |
Post the whole function, just because it echoed the account name, that doesn't mean anything.
|
Well, it works now I fixed it. Here's if anyone was wondering how I did it.
NPC Code:player.chat = "control/accounts/"@(player.account.substring(0,(player.account.leng th)+2))@"/" @ player.account @ ".txt"; |
NPC Code:params[3].client.guildrank = temp.tokens[0]; It doesn't work when I'm using params[3] though... here's what send the params.. NPC Code: params[1] should be Recruit|1 params[2] should be Sshhh params[3] should be Graal711249 |
params[3] is sending your account name, not the player object.
If you wanted, you could do something like this: PHP Code:
|
Thanks. But findplayer only works when they're online..
|
Quote:
You can't load vars from an offline player anyway. params[3] is an account name, it's just a string. It doesn't mean anything, so you can't saveVars it and expect it to have the client.vars, etc. |
So in other words, it's impossible to read/change the client variables of a player that is offline?
|
Quote:
|
Yes, I've done that as an alternative. Thanks for all the help, I appreciate it. :)
|
| All times are GMT +2. The time now is 04:38 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.