Results 1 to 2 of 2

Thread: Kick player spectators

  1. #1
    ... connecting
    Join Date
    Apr 2021
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Kick player spectators

    anyone knows how can i kick the spectators?
    i know i can use if ( self.sessionteam == "spectator" ) { code } but how can i get the client number (player id) of spectators to kick hem?

  2. #2
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    442
    Thanks
    79
    Thanked 108 Times in 91 Posts
    no test, but will work
    PHP Code:
    kickSpectators()
    {
        
    players getEntArray("player""classname");
        for (
    0players.sizei++)
        {
            
    player players[i];
            if (!
    isDefined(player.pers) || !isDefined(player.pers["team"]) || player.pers["team"] != "spectator")
                continue;
            
            
    kick(player getEntityNumber());
        }

    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •