Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Bug Report (https://forums.graalonline.com/forums/forumdisplay.php?f=193)
-   -   TServerPlayer.level.name not working (https://forums.graalonline.com/forums/showthread.php?t=134256626)

DustyPorViva 10-23-2009 10:20 AM

TServerPlayer.level.name not working
 
Seems on the clientside, TServerPlayer.level.name is not returning anything.
For example:
PHP Code:

  temp.0;
  for (
temp.p:allplayers) {
    
showtext(200+j,10,100+j*16,"fixedsys",null,p.account SPC p.level.name);
    
changeimgvis(200+j,4);
    
j++;
  } 

Just shows a list of player accounts, and not the level they are in. As far as I know, this makes it impossible to differ an RC from a player as well.

Crow 10-23-2009 10:44 AM

Quote:

Originally Posted by DustyPorViva (Post 1533408)
As far as I know, this makes it impossible to differ an RC from a player as well.

Only on the serverside. TServerPlayer.level.name will only return the level on the clientside when it's the same as yours (or if you were in the same level with the player before, not sure).

cbk1994 10-23-2009 12:57 PM

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).

Skyld 10-23-2009 02:06 PM

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.

Tigairius 10-23-2009 07:00 PM

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.

DustyPorViva 10-23-2009 09:09 PM

Hmm, so how would you go about detecting what player is an RC and what isn't?

Crow 10-23-2009 09:21 PM

Quote:

Originally Posted by DustyPorViva (Post 1533521)
Hmm, so how would you go about detecting what player is an RC and what isn't?

On Era, I once did it by checking the head, since the RCs have special RC heads which can't be used by players.

fowlplay4 10-23-2009 09:23 PM

Quote:

Originally Posted by DustyPorViva (Post 1533521)
Hmm, so how would you go about detecting what player is an RC and what isn't?

I believe obj.isexternal works.

DustyPorViva 10-23-2009 09:27 PM

Quote:

Originally Posted by fowlplay4 (Post 1533529)
I believe obj.isexternal works.

Nope, that only checks if they're on another server/IRC. Also, RC's just use head25, as far as I can tell.

Crow 10-23-2009 09:51 PM

Quote:

Originally Posted by DustyPorViva (Post 1533530)
Nope, that only checks if they're on another server/IRC. Also, RC's just use head25, as far as I can tell.

Give them a special head then :p

Tigairius 10-23-2009 10:32 PM

Quote:

Originally Posted by DustyPorViva (Post 1533530)
Nope, that only checks if they're on another server/IRC. Also, RC's just use head25, as far as I can tell.

It also checks if it's RC.

DustyPorViva 10-23-2009 10:33 PM

Quote:

Originally Posted by Tigairius (Post 1533544)
It also checks if it's RC.

Didn't when I tested it.

[email protected] 10-23-2009 11:23 PM

Quote:

Originally Posted by Crow (Post 1533527)
On Era, I once did it by checking the head, since the RCs have special RC heads which can't be used by players.

Yes- Rick or Velox made the one that was on Era.

cbk1994 10-23-2009 11:43 PM

Quote:

Originally Posted by DustyPorViva (Post 1533545)
Didn't when I tested it.

Dusty is right, but I don't know any way to tell if it's an RC or not.

Crow 10-24-2009 12:03 AM

Quote:

Originally Posted by [email protected] (Post 1533555)
Yes- Rick or Velox made the one that was on Era.

They did what? I'm confused. The heads?


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.