Forum

> > CS2D > Scripts > Player id in table
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Player id in table

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Player id in table

phalenkO
User Off Offline

Zitieren
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

alt Re: Player id in table

haha1955
User Off Offline

Zitieren
@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

alt Re: Player id in table

AtomKuh
User Off Offline

Zitieren
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

alt Re: Player id in table

Bowlinghead
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht