Hi Guys, i have make a script:
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.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; }
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?

Reply With Quote