Quote:
Originally Posted by Bleachlover551
Also do u have a kickall script? if i may ask?
|
Scripting isn't really a matter of "what is the script for ...?", it's more about "which way would I script ...?".
A simple method to kick all players would be to loop through the built-in 'players' array.
One way of looping through the array would be:
PHP Code:
for(temp.pl : players){
if(temp.pl.guild != "Events"){
temp.pl.setlevel2("levelname.nw", x, y);
}
}
Note how temp.pl would be in reference to each player within the level (or each element within the 'players' array).
Variables which start with the 'temp.' prefix are simply temporary values.
Another would be:
PHP Code:
temp.playercount = players.size();
for(temp.i = 0; temp.i < temp.playercount; temp.i ++){
if(players[temp.i].guild != "Events"){
players[temp.i].setlevel2("levelname.nw", x, y);
}
}
Note how temp.i is being incremented up to the last index value of the players array, and then how the players array elements are being read from directly by specifying the index.