Forum

> > Carnage Contest > I need to find a way around this...
ForenübersichtCarnage Contest-ÜbersichtEinloggen, um zu antworten

Englisch I need to find a way around this...

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt I need to find a way around this...

DannyDeth
User Off Offline

Zitieren
Hi there
I am busy scratching a new game-mode for CC, I am making it like a game of paintball, but I need to find a way to know exactly the number of all the players, so that i can draw masks over their faces. I have searched the Help documents on carnagecontest.com adn couildn't find anything except the cc cmd playertable command, which returns an array, but I just want to get a number of all the players, minus one from that ( so the current player is also drawn ) and run the drawimage command from inside a for loop. Anyhelp is appreciated

Thnx, DannyDeth

alt Re: I need to find a way around this...

DC
Admin Off Offline

Zitieren
you can use the #-operator of Lua to get the number of elements in a Lua table.

#getplayertable()

1
2
3
4
players=getplayertable()
for i=1,#players do
	... getplayerx(players[i]) ... etc...
end

you might want to check some scripts which use this technique. the horizontal/vertical laser script for example.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenCarnage Contest-ÜbersichtForenübersicht