Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2255 256 257338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

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

alt Re: Lua Scripts/Questions/Help

murilog
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

CeLiL_CaN
User Off Offline

Zitieren
murilog hat geschrieben
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)]

alt hello.

Pwncookies
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

senar
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
senar hat geschrieben
@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

alt Re: Lua Scripts/Questions/Help

Blacko
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

murilog
User Off Offline

Zitieren
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
1× editiert, zuletzt 10.09.10 20:59:32

alt Re: Lua Scripts/Questions/Help

kalis
User Off Offline

Zitieren
heocon953 hat geschrieben
help me script
if player go in tiles parse he can't go in tiles water

help me pls
thkx
1× editiert, zuletzt 11.09.10 10:38:12

alt Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

kalis
User Off Offline

Zitieren
Snake_Eater hat geschrieben
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
1× editiert, zuletzt 11.09.10 10:52:17
Zum Anfang Vorherige 1 2255 256 257338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht