English Team 1 And Team 2 (Player Alpha)

3 replies
Goto Page
To the start Previous 1 Next To the start
Up
KaBooMa
User
Offline Off
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
27.02.11 02:31:27 pm
Up
Flacko
User
Offline Off
You're doing it wrong

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

You're using the table length as the player id (same for TName)
27.02.11 02:35:14 pm
Up
DC
Admin
Offline Off
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.

Code:
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
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
27.02.11 02:35:36 pm
Up
KaBooMa
User
Offline Off
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