Forum

> > CS2D > General > Lua scripting
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Lua scripting

31 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt Re: Lua scripting

wolfteam32
User Off Offline

Zitieren
1. I dont know why it is "lua.lua" in folder is just "server.lua" and nothing else
2. I have that file because when im put this sound file when someone is killing someone that sound has be played
1
2
parse("sv_sound \"fun/sonofabitch.wav\"")
msg (player(killer,"name").." is killing like Duke Nukem!! "..level.." KILLS!@C")

Edit: Yay its works thx so much guys!!!

Edit2: another question: How to play another sound when CT or T win ?? In Hero script i see this and i cant do that always i have error pls help!
3× editiert, zuletzt 02.07.09 17:51:31

alt Re: Lua scripting

SQ
Moderator Off Offline

Zitieren
Wait.
I will make in same method like in my super hero
(5 mins)
Its not changing sound.
Round start + type of winning sound

alt Re: Lua scripting

SQ
Moderator Off Offline

Zitieren
There is my example.
(I havent tested it , but thats the way im using in my super hero script)

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
addhook("team","choseteam")
function choseteam(id,team)
	pteam[id]=team
end

addhook("startround","startr")
function startr()
	local i
	for i=1,32 do
		twin=game("winrow_t")
		ctwin=game("winrow_ct")
		if ctwin>0 then
			if pteam[i]==1 then parse("sv_sound2 "..i.." \"hero/roundend.ogg\"");end
			if pteam[i]==2 then parse("sv_sound2 "..i.." \"hero/roundend2.ogg\"");end
		end
		if twin>0 then
			if pteam[i]==2 then parse("sv_sound2 "..i.." \"hero/roundend.ogg\"");end
			if pteam[i]==1 then parse("sv_sound2 "..i.." \"hero/roundend2.ogg\"");end
		end
	end
end

function initArray(m)
local array = {}
	for i = 1, m do
	array[i]=0
	end
return array
end

pteam=initArray(32)

alt Re: Lua scripting

wolfteam32
User Off Offline

Zitieren
thx work

Edit: How to do a comands for sample person. Np only for me and if this lua is on another serwer I type !laser and i got laser and anybody cant. PLs help!!

Edit 2: It is correct??
1
2
check (p,"name") if (name=="Sakarji") then
if (txt=="!laser") then parse("equip "..p.." 45"); end
2× editiert, zuletzt 06.07.09 17:53:54

alt Re: Lua scripting

wups
User Off Offline

Zitieren
mortyr22, can you stop flood your message everywhere about shoot 2 and then reload.

Why not use the noreload code at the filessection?
And then recode it.
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht