View Single Post
  #2  
Old 02-06-2006, 05:58 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Idrox0
Hey there, I'm a good scripter, but I've done next to nothing of online stuff. My question is, how do I go through the players in a level in a for loop? I do for (i=0;i<playerscount;i++) serverside and nothing happens, clientside and only I am affected. How do I access everyone in a level?
This'll need to be done serverside.

In old gscript, it'll be something like this:
PHP Code:
for (0playerscount++)
{
  
with (players[i])
  {
    
// Now in the focus of the player
    
setplayerprop #c,Hello!;
  
}

Just for reference, in gscript2, the improved for () allows you to cycle straight through the players array, like so:
PHP Code:
for (plplayers)
{
  
// Now, pl will be the player's object, i.e.
  
pl.chat "Hello!";

__________________
Skyld
Reply With Quote