![]() |
Player level/gmap in clientside allplayers loop
I'm trying to find out the level/gmap name of other players looping through allplayers on the clientside. Doesn't seem to work. obj.level.name and obj.gmap.name always return nothing. Any advice?
|
for(a: allplayers) {
urvariable = a.level; } should work fine? |
It'd be:
PHP Code:
|
try using players instead of allplayers,
PHP Code:
|
Quote:
|
I don't think you'll be able to read player attributes, either. You only load information from players in the same level, iirc.
|
Quote:
|
Yeah, the problem is that player information isn't sent to you after they are more than 1 level away I think. This area can be altered with some recently added server options, but it isn't really a solution here since making the area too large would lag everything down.
The only solution, as far as I know, is the attribute/server option thing that you mentioned. |
Any chance you could share what you're trying to accomplish?
|
Player info is sent, it's just updated less frequently(only when the player changes level). However, it's just certain information.
|
Use player.levelname instead of player.level.name because levelname is sent to all players.
|
Personally, I encountered a problem like this when making a minimap, because you won't have the exact player coordinates after they move far away enough. My solution was just to fade players out after they are far away enough, but I think we're going to change it soon.
|
Quote:
|
Quote:
Quote:
Quote:
And we have a winner ^^ I fade on the minimap, but my minimap is, at the same time, my large map. And I don't want to fade on the large map. |
I'm pretty new to scripting, and this might be a terrible idea but can't you do this.
Add this to allplayers PHP Code:
PHP Code:
|
Quote:
|
Hey, thanks for the bump. Reminded me of the issue and that we apparently have this player.levelname thingy in v6. Gotta try that later.
|
| All times are GMT +2. The time now is 07:22 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.