Forum

> > CS2D > Scripts > Player id in table
Forums overviewCS2D overview Scripts overviewLog in to reply

English Player id in table

4 replies
To the start Previous 1 Next To the start

old Player id in table

phalenkO
User Off Offline

Quote
This about I asked the cs2d.com but I dont understand correctly. Too there is problem but I think main problem:
1
player(id,"name")
. Maybe this attempt shouldnt with that table?

> "attempt to index global 'id' (An nil value)"
Im tried the this:
1
id = true
.

1
2
3
4
5
6
7
attempt = { 
["err"] = ""..player(id,"name").." attempt after messega",
} 
addhook("join","welcome")
function welcome(i) 
msg(attempt["err"]) 
end

old Re: Player id in table

haha1955
User Off Offline

Quote
@user Gaios: you just provoke people with it, stop it or I'll make sure that you finally stop it!
if you have no idea, you should just be still and give the other people the opportunity to answer instead of you. what are you actually responsible for? for safety? because I do not feel safe if you do not do your job

old Re: Player id in table

AtomKuh
User Off Offline

Quote
Put the table in the function and use the same variable for the first paramter (for example id)

The first paramater is for the ID (so u can use a variable called id):
1
2
3
4
5
6
7
addhook("join","welcome")
function welcome(id)
local attempt = { 
["err"] = ""..player(id,"name").." attempt after messega",
}
msg(attempt["err"]) 
end

You can also use "sexy" for the first parameter:
1
2
3
4
5
6
7
addhook("join","welcome")
function welcome(sexy)
local attempt = { 
["err"] = ""..player(sexy,"name").." attempt after messega",
}
msg(attempt["err"]) 
end

old Re: Player id in table

Bowlinghead
User Off Offline

Quote
What the fuck?
The thread doesnt include any understandable question neither the problem is clear.
The code itself shows that the author has no clue what hes doing.
The experience shows that you have to explain everything 3 times until people that use translator understand what you want (like: show us the full code).
Then people invested very much time into writing a tutorial to introduce Lua and instead of being thankful you threat "to stop" them?! Actually you sound like you are 12 years old indeed
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview