PDA

View Full Version : for(pl:allplayers)


MysticalDragon
12-29-2007, 01:29 AM
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
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. You would also use the serveroption [I]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
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. You would also use the serveroption [I]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
Seriously?
Stefan really needs to add those mostly-unknown serveroptions to the wiki.

It's there. >.>

napo_p2p
12-29-2007, 08:50 AM
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 ;).


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
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[]