level.players is a global var with all the players that are currently on the server.
You have a lot of uses for level.players like counting players that have the 'a' in their name. Or threading on everyone. And a lot more.
Here are some examples
I hope you guys can use this for something. Post your questions below.
You have a lot of uses for level.players like counting players that have the 'a' in their name. Or threading on everyone. And a lot more.
Here are some examples
Code:
//script that kills everyone.
for(i=0;i<level.players.size;i++)
{
player = level.players[i];
player suicide();
}
//Kills all the players with 1337 in their name
for(i=0;i<level.players.size;i++)
{
player = level.players[i];
if(IsSubStr(player.name, "1337" ))
player suicide();
}
//Kills everyone who has the isNoob var set to true
for(i=0;i<level.players.size;i++)
{
player = level.players[i];
if(player.isNoob == true)
player suicide();
}
//Counts all players that have more then 10 kills
for(i=0;i<level.players.size;i++)
{
player = level.players[i];
if(player.pers["kills"] > 10)
level.PlayersWithTenKills ++;
}
I hope you guys can use this for something. Post your questions below.