Forum

> > CS2D > Scripts > Setpos lua error.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Setpos lua error.

15 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Setpos lua error.

Yates
Reviewer Off Offline

Zitieren
I have this setpos lua, when you spawn and if your usgn is in the lua you spawn somewhere else. In this case 817 1978.
But I got an error in the console.
')' expected near '1978'
And I can't figure out why it gives me this, I mean it has an ) so wtf?
1
2
3
4
5
6
7
8
addhook(spawn,fgspawn)
function fgspawn(id)
for id=1,32 do
if player(id,usgn)==21431 then
parse(setpos ..id.. 817 1978)
end
end
end
It did work, but now suddenly doesn't. Very annoying actually.
So, anyone know what's wrong?
Thanks.

alt Re: Setpos lua error.

Yasday
User Off Offline

Zitieren
You should use strings:
"usgn"
"setpos " .. id .. " 817 1978"
and you should delete that for id = 1, 32 do, because the id parameter is already given ( and I don't think you want to be teleported when someone spawns ).

alt Re: Setpos lua error.

Yates
Reviewer Off Offline

Zitieren
So. What i understand.
1
2
3
4
5
6
7
addhook(spawn,fgspawn)
function fgspawn(id)
if player(id,"usgn")==21431 then
parse("setpos " ..id.. " 817 1978")
end
end
end

alt Re: Setpos lua error.

Precel97
User Off Offline

Zitieren
Semsi! Read rules... Add this to your theard.Off topic
1× editiert, zuletzt 25.04.11 12:34:08

alt Re: Setpos lua error.

Yasday
User Off Offline

Zitieren
@semisi
This hasn't anything to do with the script, has it?

They're created like every other map, by opening the editor and mapping.

alt Re: Setpos lua error.

Surplus
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
adminlist={"USIDHER","USIDHER","USIDHER"}

addhook(spawn,fgspawn)
function fgspawn(id)
for index,USGN in ipairs(adminlist) do
if player(id,usgn)== USGN
parse(setpos ..id.. 817 1978)
end
end

Your script turned into multiple usgn system thing. Dunno whats it called. Might work.

EDIT: Forgot to edit a thing, should work now
1× editiert, zuletzt 25.04.11 13:18:14

alt Re: Setpos lua error.

Yasday
User Off Offline

Zitieren
It won't work. Try it and you'll see that it's shit. No strings, false table and so on...
Edit:
Won't work anyways.

alt Re: Setpos lua error.

loldlold123
User Off Offline

Zitieren
addhook(spawn,fgspawn)
function fgspawn(id)
for id=1,32 do
if player(id,usgn)==21431 then
parse(setpos ..id.. 817 1978)
end
end
end

are you joking there is no ( " ) and for id =1,32 do is junk

addhook("spawn","fgspawn")
function fgspawn(id)
if player(id,usgn)==21431 then
parse("setpos "..id.." 817 1978")
end
end

this is correct
1× editiert, zuletzt 25.04.11 20:49:34

alt Re: Setpos lua error.

Yates
Reviewer Off Offline

Zitieren
Yes, I know.
I didn't make it I got it, and it used to work.
One answer is enough, you don't have to repeat it, no use.

alt Re: Setpos lua error.

Yasday
User Off Offline

Zitieren
user loldlold123 hat geschrieben
addhook(spawn,fgspawn)
function fgspawn(id)
for id=1,32 do
if player(id,usgn)==21431 then
parse(setpos ..id.. 817 1978)
end
end
end

are you joking there is no ( " ) and for id =1,32 do is junk

addhook("spawn","fgspawn")
function fgspawn(id)
if player(id,usgn)==21431 then
parse("setpos "..id.." 817 1978")
end
end

this is correct

Did you even try to read the whole thread?

alt Re: Setpos lua error.

loldlold123
User Off Offline

Zitieren
user Yates hat geschrieben
So. What i understand.
1
2
3
4
5
6
7
addhook(spawn,fgspawn)
function fgspawn(id)
if player(id,"usgn")==21431 then
parse("setpos " ..id.. " 817 1978")
end
end
end


addhook((here)spawn(here),(here)fgspawn(here))
function fgspawn(id)
if player(id,"usgn")==21431 then
parse("setpos " ..id.. " 817 1978")
end
end
end

can you see "here"

alt Re: Setpos lua error.

loldlold123
User Off Offline

Zitieren
ok im sorry but i dont see last posted code " near hook and i post it...pls dont continue to say somethings.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht