Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-29-2007, 01:29 AM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
for(pl:allplayers)

How can i access client.strings via for(pl:allplayers) ?
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
  #2  
Old 12-29-2007, 01:38 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
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.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 12-29-2007, 02:24 AM
trevor987 trevor987 is offline
Registered User
Join Date: Jun 2007
Posts: 20
trevor987 is on a distinguished road
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.
Reply With Quote
  #4  
Old 12-29-2007, 02:28 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by MysticalDragon View Post
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
__________________
Reply With Quote
  #5  
Old 12-29-2007, 02:40 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
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.
__________________
Reply With Quote
  #6  
Old 12-29-2007, 08:38 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Quote:
Originally Posted by Inverness View Post
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.
__________________
Trying to be nice now...
Reply With Quote
  #7  
Old 12-29-2007, 08:40 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by bscharff View Post
Seriously?
Stefan really needs to add those mostly-unknown serveroptions to the wiki.
It's there. >.>
__________________
Deep into the Darkness peering...
Reply With Quote
  #8  
Old 12-29-2007, 08:50 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by bscharff View Post
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 View Post
It's there. >.>
Yes, it is in the wiki. Not on the server option page though :P.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #9  
Old 12-29-2007, 06:58 PM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
Thank You all for the help and, and a special thanks to Inverness <3
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
  #10  
Old 12-29-2007, 08:01 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Hmm, well it seems allplayers is for all players on the server... is there one for just all the players in the level?
Reply With Quote
  #11  
Old 12-29-2007, 08:05 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by DustyPorViva View Post
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 )
__________________
Reply With Quote
  #12  
Old 01-02-2008, 12:51 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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[]
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:26 AM.


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