Forum

> > Carnage Contest > I need to find a way around this...
Forums overviewCarnage Contest overviewLog in to reply

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

2 replies
To the start Previous 1 Next To the start

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

DannyDeth
User Off Offline

Quote
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

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

DC
Admin Off Offline

Quote
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.
To the start Previous 1 Next To the start
Log in to replyCarnage Contest overviewForums overview