English Player id in table

4 replies
Goto Page
To the start Previous 1 Next To the start
02.06.19 04:14:36 pm
Up
phalenkO
User
Offline Off
This about I asked the cs2d.com but I dont understand correctly. Too there is problem but I think main problem:
Code:
1
player(id,"name")
. Maybe this attempt shouldnt with that table?

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

Code:
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
02.06.19 06:37:21 pm
Up
Gaios
Security Supporter
Offline Off
02.06.19 09:34:50 pm
Up
haha1955
User
Offline Off
@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
02.06.19 10:05:40 pm
Up
AtomKuh
User
Offline Off
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):
Code:
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:
Code:
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
02.06.19 10:12:43 pm
Up
Bowlinghead
User
Offline Off
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
Share time limited free games here
To the start Previous 1 Next To the start