Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   for(pl:allplayers) (https://forums.graalonline.com/forums/showthread.php?t=78112)

MysticalDragon 12-29-2007 01:29 AM

for(pl:allplayers)
 
How can i access client.strings via for(pl:allplayers) ?

xXziroXx 12-29-2007 01:38 AM

If done client side, you cant. Serverside do pl.client.string. You can only read player information clientside (very limited though) if the player is in the same level as you are.

trevor987 12-29-2007 02:24 AM

Someone told me you can set player.attr[28] or player.attr[29] to a value of your choice which can be read by other players... I've not tried it yet, but it may be useful to experiment. Also, does anyone know if arrays work with it? I did try that and had no success, but I could be doing something wrong.

cbk1994 12-29-2007 02:28 AM

Quote:

Originally Posted by MysticalDragon (Post 1366466)
How can i access client.strings via for(pl:allplayers) ?

client.var is really player.client.var

The same goes for clientr variables. However, you don't always need to use player. An example would be addweapon, which is really player.addweapon.

So yes, pl.client.foo

Inverness 12-29-2007 02:40 AM

You cannot access other people's client variables on your clientside.

However if there are client variables you need accessible to all on the clientside set it to player.attr[index]. You would also use the serveroption sendtoallattr which is an array of the player attribute indexes you want sent to all other players even if they're not in the level.

bscharff 12-29-2007 08:38 AM

Quote:

Originally Posted by Inverness (Post 1366483)
You cannot access other people's client variables on your clientside.

However if there are client variables you need accessible to all on the clientside set it to player.attr[index]. You would also use the serveroption sendtoallattr which is an array of the player attribute indexes you want sent to all other players even if they're not in the level.

Seriously?
Stefan really needs to add those mostly-unknown serveroptions to the wiki.

Angel_Light 12-29-2007 08:40 AM

Quote:

Originally Posted by bscharff (Post 1366536)
Seriously?
Stefan really needs to add those mostly-unknown serveroptions to the wiki.

It's there. >.>

napo_p2p 12-29-2007 08:50 AM

Quote:

Originally Posted by bscharff (Post 1366536)
Seriously?
Stefan really needs to add those mostly-unknown serveroptions to the wiki.

You can always update the page yourself, now that you know about it ;).


Quote:

Originally Posted by Angel_Light (Post 1366537)
It's there. >.>

Yes, it is in the wiki. Not on the server option page though :P.

MysticalDragon 12-29-2007 06:58 PM

Thank You all for the help and, and a special thanks to Inverness <3

DustyPorViva 12-29-2007 08:01 PM

Hmm, well it seems allplayers is for all players on the server... is there one for just all the players in the level?

cbk1994 12-29-2007 08:05 PM

Quote:

Originally Posted by DustyPorViva (Post 1366635)
Hmm, well it seems allplayers is for all players on the server... is there one for just all the players in the level?

Simply players

for ( pl: players )

Admins 01-02-2008 12:51 PM

There is players[] which is for the players in the current level, or the players around you (3x3 levels) if you are on a gmap.
If you want to access all players of the level even if you are on gmap, then use this.level.players[].
To access all players use allplayers[]


All times are GMT +2. The time now is 11:32 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.