Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.
Forum
CS2D Scripts Lua Scripts/Questions/HelpAnother little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.
Skipper has written
Thank you.
Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.
Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.
w00t, Explain better i understand NADA
HaRe has written
w00t, Explain better i understand NADA
Skipper has written
Thank you.
Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.
Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.
w00t, Explain better i understand NADA
look, for example, I want that you say !random and then you have to wait 5 seconds and you get a random weapon. that !random and the random weapon are not the problem, the wait time is my problem.
Skipper has written
look, for example, I want that you say !random and then you have to wait 5 seconds and you get a random weapon. that !random and the random weapon are not the problem, the wait time is my problem.
HaRe has written
w00t, Explain better i understand NADA
Skipper has written
Thank you.
Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.
Another little question: Is it easily possible to build in a little wait function - like wait 2 seconds - and then he's proceeding the next step? Would be interesting.
w00t, Explain better i understand NADA
look, for example, I want that you say !random and then you have to wait 5 seconds and you get a random weapon. that !random and the random weapon are not the problem, the wait time is my problem.
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
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
function Array(m) 	local array = {} 	for i = 1, m do 		array[i]=0 	end 	return array end timeplayer = Array(32) addhook("say","sayrandom") function sayrandom(id,) 	if t=="!random" then 		if (timeplayer[id]>5) then 			timeplayer[id]=0 			parse("equip "..id.." math.random(1,3)") 			return 1 		else 			msg2(id,"You cant type it yet") 			return 1 		end 	end end addhook("second","randomsec") function randomsec() 	for id = 1,32 do 		if (player(id,"exists")) then 			timeplayer[id]=timeplayer[id]+1 		end 	end end
Money : 2000
!givemoney 1 200
later
Money 1800
1
2
3
2
3
..... parse ("setpos "..id.." "..math.random(1,2000).." "..math.random(1,2000)) .....
I want if the first math.random is 1345 that the second math.random is 1345 too.
How to make??
function ssss (id,src,wpn)
if wpn==1 then
if (sample.classes.class[id]==1) then
if (sample.classes.class[src]==5) then
parse("setpos "..id.." 10 10")
msg2( id, " "..player(source,"name").." Tarafindan Hapse Tikildin...")
end
end
end
end
whats wrong??
1
2
2
local var=math.random(1,2000) parse ("setpos "..id.." "..var.." "..var)
You cant use the vaule src and later source ,only one is possible
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
addhook("hit","ssss") function ssss (id,src,wpn) 			<-- here you use src if wpn==1 then if (sample.classes.class[id]==1) then if (sample.classes.class[src]==5) then parse("setpos "..id.." 10 10") msg2( id, " "..player(source,"name").." Tarafindan Hapse Tikildin...") 			<-- here you use source end end end end
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
CeLiL_CaN has written
What is zombie, headcrap and snark object type?
Help me please..
if player go in tiles parse he can't go in tiles water
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
You spawn with random items. If i write it would do 1-6 weapons but what to do to example get 3 or 5 or 6 ?
Plz explain me this math.random stuff
Example: math.random(10,50) = random number between 10 and 50.
edited 1×, last 10.09.10 04:01:55 pm