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 2257 258 259338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
@Alex
Change this
1
2
3
4
5
rp_license = Array(32,false)
player_have_pos = Array(32,false)
collect = Array(32,1)
tele_x = Array(32,0)
tele_y = Array(32,0)
To this
1
2
3
4
5
rp_license = initArray(32,false)
player_have_pos = initArray(32,false)
collect = initArray(32,1)
tele_x = initArray(32,0)
tele_y = initArray(32,0)
@Celil
spawnobject 30 x y rot 0 0 player
Where player must be a value between 1 and 3

old Re: Lua Scripts/Questions/Help

t4r
User Off Offline

Quote
Can someone help me with this lua scripts?
I am looking for an script which changes to a specific map
when there are 0 players on Server.

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

old Re: Lua Scripts/Questions/Help

Alex_Aaa789
User Off Offline

Quote
New one but when I press f3 and f4 it won't show menu:

Spoiler >


sorry for asking too much

old Re: Lua Scripts/Questions/Help

Evool
User Off Offline

Quote
Hello.
Please write me script for RP, which movies all players to TT, even if it going to CT. But Admins which have RCONs, may go to CT.

Yes, this script is on the WFW RP.

Sorry for my bad english.

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
CeLiL_CaN has written
HaRe has written
CeLiL_CaN has written
@Flacko Thanks for help ...

I have new question

Can i spawn zombies with 500 hp?


check my lua script , ive made an script for that

http://unrealsoftware.de/files_show.php?file=2099

HaRe i dont want it..I want NPC ZM with 500 hp.. with: cs2d cmd spawnobject


i think it works fine with NPC too?? but you just have to change

1
if (player(id,"team") == 1) then

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

old Re: Lua Scripts/Questions/Help

TDShuft
User Off Offline

Quote
Spoiler >

sum 1 help pl0x
i want a broadcast system using
"owner(id)" and the others please help
edited 1×, last 13.09.10 02:20:34 am

old Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Quote
shuft has written
Spoiler >

sum 1 help pl0x


post the whole script -.-

old Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Quote
senar has written
Hi again.
can some one post a script that make you when you kill npc you get 300$ please?

NPC is an object type 30, so...
1
2
3
4
5
6
addhook("objectkill","npckill")
function npckill(id,playerid)
	if object(id,"type")==30 then --checks if this object is NPC
		parse("setmoney "..playerid.." "..(player(playerid,"money")+300)) --adds $300
	end
end

old Re: Lua Scripts/Questions/Help

CJ7
BANNED Off Offline

Quote
@Alex_Aaa789:

Fixed it a little bit, but your menu's in the serveraction hook are still wrong. I don't know what the purpose of this script is, and why everyone wants to have this license stuff..

Spoiler >
To the start Previous 1 2257 258 259338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview