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 (i = 0; i < playerscount; i ++)
{
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 (pl: players)
{
// Now, pl will be the player's object, i.e.
pl.chat = "Hello!";
}