Spawn on Pos Lua
2 replies



04.08.13 01:36:09 pm
i want some lua if someone has the right usgn id,to give them an option in F2 to spawn normally,or a pos i set.
F2>Spawn
You will now spawn normally.
You will now spawn on your house.
F2>Spawn
You will now spawn normally.
You will now spawn on your house.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
tbl = {99999}
isfine = {}
addhook("join","whoiswho")
function whoiswho(id)
isfine[id]=0
end
addhook("serveraction","makefine")
function makefine(id,b)
if b == 1 then
for _,usgn in ipairs(tbl) do
if player(id,"usgn")==usgn then
if isfine[id]==0 then
isfine[id]=1
msg2(id,"Your text here")
elseif isfine[id]==1 then
isfine[id]=0
msg2(id,"Your text here")
end
end
end
end
end
addhook("spawn","magic")
function magic(id)
if isfine[id]==1 then
timer(1000,"parse","setpos "..id.." 999 999")
end
end
isfine = {}
addhook("join","whoiswho")
function whoiswho(id)
isfine[id]=0
end
addhook("serveraction","makefine")
function makefine(id,b)
if b == 1 then
for _,usgn in ipairs(tbl) do
if player(id,"usgn")==usgn then
if isfine[id]==0 then
isfine[id]=1
msg2(id,"Your text here")
elseif isfine[id]==1 then
isfine[id]=0
msg2(id,"Your text here")
end
end
end
end
end
addhook("spawn","magic")
function magic(id)
if isfine[id]==1 then
timer(1000,"parse","setpos "..id.." 999 999")
end
end



