Forum

> > CS2D > Scripts > Team 1 And Team 2 (Player Alpha)
Forums overviewCS2D overview Scripts overviewLog in to reply

English Team 1 And Team 2 (Player Alpha)

3 replies
To the start Previous 1 Next To the start

old Team 1 And Team 2 (Player Alpha)

KaBooMa
User Off Offline

Quote
Alright, So I'm making a script ( Ain't I always ) And im calling the the only player alive. How would i manage that. Right now i have this:

CTName = (player(#player(0,"team2living"),"name"))
TName = (player(#player(0,"team1living"),"name"))

When it shows what they are ingame, It says it's Me for both them. No matter what team im on. Any ideas?
edited 1×, last 27.02.11 02:57:15 pm

old Re: Team 1 And Team 2 (Player Alpha)

DC
Admin Off Offline

Quote
player(0,"team2living") and player(0,"team1living") return a Lua table, right?

# returns the quantity of elements in a Lua table, right?

but player(id,"attribute") expects a player id for id, correct?

do you see your mistake? you are using the number of elements in a table as player id. but it's not a player ID. its a quantity. this can't work.

1
2
3
4
5
6
cts=player(0,"team2living")
if (#cts==1) then
	CTName=player(cts[1],"name")
else
	CTName="no or multiple CTs alive"
end
edited 2×, last 27.02.11 02:36:46 pm

old Re: Team 1 And Team 2 (Player Alpha)

KaBooMa
User Off Offline

Quote
Thanks! Change you give a example?

EDIT: Dc, you're hovering over me every second like i did something. Lol, im guessing you're active about this day. Anyway, Thanks a lot for explaining that for me. I keep learning or and more! I got the One And Only script working now! Since you're most likely waiting for my response back, Can you also tell me if you can change a players alpha with lua? The soldier mod im making adds a slight alpha to the player in cs 1.6. If not i guess i can try to find a way to do so. Thanks for ALL the help you have gave me these past hours.
edited 1×, last 27.02.11 02:56:53 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview