Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2255 256 257338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
Do you mean that if i make example Say hook. I say something and after that u get in random weapon 10 or weapon 50 ? or you get randomly 10,11,12,13,14,15 and so on till 50 ? I want to know how to make EXACTLY 50 or 10 not between them.

old Re: Lua Scripts/Questions/Help

murilog
User Off Offline

Quote
Code:
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> whit this script

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
Just that you spawn with random weapon and random grenade 200 hp and 10 speed. No laser rpg or Portal gun plz.And of course a random wep "sight -_-" Can be armor too

old Re: Lua Scripts/Questions/Help

CeLiL_CaN
User Off Offline

Quote
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
t = {1,3,5}
a = t[math.random(1,3)]

old hello.

Pwncookies
User Off Offline

Quote
Hello, would anyone be so kind to tell/make/post a script to make an image appear on everyone's screen on join?

More detailed(i think):
Player joins - Now an image appears on his screen and stays there.

Thank you.

old Re: Lua Scripts/Questions/Help

senar
User Off Offline

Quote
@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?

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
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?


first of all ur wrong with the impossible thing that u tould pwncookies

and second that impossible that you said with the Spray

old Re: Lua Scripts/Questions/Help

Blacko
User Off Offline

Quote
Hi all ! I want a scipt for my RolePlay Server, just a script who save money, license and more with USGN ...
Please help me !
Thanks you !

old Re: Lua Scripts/Questions/Help

murilog
User Off Offline

Quote
Code:
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

old Re: Lua Scripts/Questions/Help

kalis
User Off Offline

Quote
heocon953 has written
help me script
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

old Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Quote
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

old Re: Lua Scripts/Questions/Help

kalis
User Off Offline

Quote
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


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
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
To the start Previous 1 2255 256 257338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview