Forum
CS2D Scripts Lua Scripts/Questions/Helpaddhook("leave","RPsave")
function RPsave(id)
if (player(id,"usgn") > 0) then
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
rp_cr[id] = 0
end
addhook("join","RPload")
function RPload(id)
if (player(id,"usgn") > 0) then
msg2(id,'Seu U.S.G.N. ID é : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end
addhook("say","SaySaveLoad")
function SaySaveLoad(id,txt)
if (txt=="!save") then
if (player(id,"usgn") > 0) then
msg2(id,'Salvando U.S.G.N. : '..player(id,"usgn")..'@C')
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
end
if (txt=="!load") then
if (player(id,"usgn") > 0) then
msg2(id,'Carregando U.S.G.N. : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end
end
function RPTransition(id,f:read("*all"))
rp_cr[id] = f
msg2(id,'Save carregado com sucesso!@C')
parse('hudtxt2 '..id..' 3 "©000000255Dinheiro : R$ '..rp_cr[id]..'" 17 430')
end
What's wrong ?
and , can make !givemoney <id> whit this script
Did you have a saves folder in "YOUR CS2D/sys/lua" ??
murilog has written
yes , the error , in console is , LUA ERROR: sys/lua/rp.lua:59: ')' expected near ':'
You try this code line 59:
1
function RPTransition(id,"f:read("*all")")
@Batlaizys
Use tables..
Like it:
1
2
2
t = {1,3,5} a = t[math.random(1,3)]
murilog has written
oh , it's wrong again , and is the same error
0.o i dont know...
the tibia npc
pleace help me
sorry for my bad english
More detailed(i think):
Player joins - Now an image appears on his screen and stays there.
Thank you.
i think that is imbossible
________________________________________________
Hi all is there is any script that makes infinity sparys?
i mean when you press 'T' you don't have to wait to do it again
is there is any?
senar has written
@pwncookies
i think that is imbossible
________________________________________________
Hi all is there is any script that makes infinity sparys?
i mean when you press 'T' you don't have to wait to do it again
is there is any?
i think that is imbossible
________________________________________________
Hi all is there is any script that makes infinity sparys?
i mean when you press 'T' you don't have to wait to do it again
is there is any?
first of all ur wrong with the impossible thing that u tould pwncookies
and second that impossible that you said with the Spray
Please help me !
Thanks you !
addhook("leave","RPsave")
function RPsave(id)
if (player(id,"usgn") > 0) then
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
rp_cr[id] = 0
end
addhook("join","RPload")
function RPload(id)
if (player(id,"usgn") > 0) then
msg2(id,'Seu U.S.G.N. ID é : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end
addhook("say","SaySaveLoad")
function SaySaveLoad(id,txt)
if (txt=="!save") then
if (player(id,"usgn") > 0) then
msg2(id,'Salvando U.S.G.N. : '..player(id,"usgn")..'@C')
f = assert(io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','w'))
f:write(rp_cr[id])
f:close()
msg2(id,"©000255000Jogo salvo com sucesso!@C")
else
msg2(id,"©000255000Falha ao salvar o jogo!@C")
end
end
if (txt=="!load") then
if (player(id,"usgn") > 0) then
msg2(id,'Carregando U.S.G.N. : '..player(id,"usgn")..'@C')
f = io.open('sys/lua/saved/'..player(id,"usgn")..'.txt','r')
if (f ~= nil) then
RPTransition(id,f)
f:close()
else
msg2(id,'Falha ao carregar seu Save!@C')
end
else
msg2(id,'Falha ao carregar seu Save!@C')
end
end
end
function RPTransition(id,f:read("*all"))
rp_cr[id] = f
msg2(id,'Save carregado com sucesso!@C')
parse('hudtxt2 '..id..' 3 "©000000255Dinheiro : R$ '..rp_cr[id]..'" 17 430')
end
What's wrong ?
and , can make !givemoney <id> <amount> whit this script
edited 1×, last 10.09.10 08:59:32 pm
heocon953 has written
help me script
if player go in tiles parse he can't go in tiles water
if player go in tiles parse he can't go in tiles water
help me pls
thkx
edited 1×, last 11.09.10 10:38:12 am
Can anybody explain me the timer function or give an sample like if I say !laser I have to wait 5 seconds then I get laser and 10 sec later I lose laser again.
pls Help
<< potal 2 >>
PLIZ need new update for cs2d (portal)
or script but who can very like portal 2 .
IT will be best !cs2d!
Snake_Eater has written
Hi all.
Can anybody explain me the timer function or give an sample like if I say !laser I have to wait 5 seconds then I get laser and 10 sec later I lose laser again.
pls Help
Can anybody explain me the timer function or give an sample like if I say !laser I have to wait 5 seconds then I get laser and 10 sec later I lose laser again.
pls Help
i have script but i have a problem
but after 10 sec laser you not lose @ @
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end laser=initArray(32) addhook("say","laser") function laser(id,t) 	if t == "!laser" then 		if laser[id] == 0 then 			laser[id]=1 		else 			return 0 		end 	end end addhook("second","lasertime") function lasertime() for i = 1, 32 do if laser[i] == 1 then laser[i]=2 elseif laser[i] == 2 then laser[i]=3 elseif laser[i] == 3 then laser[i]=4 elseif laser[i] == 4 then laser[i]=5 elseif laser[i] == 5 then msg2(i,"You have laser!!@C") parse("equip "..i.." 45") laser[i]=6 elseif laser[i] == 6 then laser[i]=7 elseif laser[i] == 7 then laser[i]=8 elseif laser[i] == 8 then laser[i]=9 elseif laser[i] == 9 then laser[i]=10 elseif laser[i] == 10 then laser[i]=11 elseif laser[i] == 11 then laser[i]=12 elseif laser[i] == 12 then laser[i]=13 elseif laser[i] == 13 then laser[i]=14 elseif laser[i] == 14 then laser[i]=15 elseif laser[i] == 15 then laser[i]=0 msg2(i,"You lose laser!!@C") parse("killplayer "..i) end end end addhook("minute","laser_msg") function laser_msg() 	msg("©255255255Type !laser to used laser :))!!!") end
edited 1×, last 11.09.10 10:52:17 am