View Single Post
  #7  
Old 07-28-2012, 12:47 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by Bleachlover551 View Post
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",  xy);
  }

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.0temp.temp.playercounttemp.++){
  if(
players[temp.i].guild != "Events"){
    
players[temp.i].setlevel2("levelname.nw",  xy);
  }

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.
Reply With Quote