Results 1 to 2 of 2

Thread: How to check axis on server?

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    How to check axis on server?

    Hi Guys, i have make a script:
    Code:
    main()
    {
    
    	//Precached String is in tdm.gsc
    	thread getDeadPlayers();
    
    }
    
    getDeadPlayers()
    {
        players = getentarray("player", "classname");
        tmp = [];
        for (i=0; i<players.size; i++)
        {
            if (players[i].pers["team"] == "axis")
            if (players[i].sessionstate != "playing")
                tmp[tmp.size] = players[i];
    	 if(tmp[tmp.size] =< 1)
    		{
    			if(!isDefined(self.oneplayer))
    			self.oneplayer = newClientHudElem(self);
    			self.oneplayer.alignx = "center";
    			self.oneplayer.x = 320;
    			self.oneplayer.y = 240; 
    			self.oneplayer.fontscale = 1.6;
    			self.oneplayer.label = &"^1There is only one Player, you must wait for a second!";
    		}
    		else if(tmp[tmp.size] >1)
    		{
    			self.oneplayer destroy();
    		}
        }
        return tmp;
    }
    Here should be look if there is 1 or 0 axis, then there should be a text, if there are 2 players, the delete the text.

    But i get this error:

    ******* script compile error *******
    bad syntax: (file 'maps/mp/gametypes/_oneplayer.gsc', line 18)
    if(tmp[tmp.size] =< 1)
    *
    ************************************

    Do somebody know why?

  2. #2
    Private
    Join Date
    Jul 2012
    Posts
    76
    Thanks
    9
    Thanked 56 Times in 38 Posts
    It's if(tmp[tmp.size] <= 1)
    not if(tmp[tmp.size] =< 1)

  3. The Following 2 Users Say Thank You to Peterlankton For This Useful Post:

    kung foo man (17th June 2013),Loveboy (17th June 2013)

Posting Permissions

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