![]() |
TServerPlayer.level.name not working
Seems on the clientside, TServerPlayer.level.name is not returning anything.
For example: PHP Code:
|
Quote:
|
I'm fairly certain TServerPlayer only exists on serverside, and if it does exist clientside, most of the variables do not work.
In the new version, there's a player.levelname, though (used for playerlist and client-RC). |
Yes the player.level.name is not set until the player is in the same level as you because you are not technically "subscribed to updates" from those players until they are close enough. As Chris said, player.levelname will provide that in the new client.
|
If you really wanted a work around and just cannot wait, you can have the player setting one of their attrs[] to their current level name, then add sendtoallattr=attrnumber to server options. You can add multiple sendtoallattrs by separating the numbers with a comma. Then you can grab player.attr[n] with a clientside script. It's recommended not to use sendtoallattrs for all attrs though because it means passing more data to the player than sometimes necessary.
You can use the onPlayerChanges(player, id) event to detect when the player enters a new level then because when an attr[] changes it invokes that function. |
Hmm, so how would you go about detecting what player is an RC and what isn't?
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 08:48 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.