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 2234 235 236338 339 Nächste Zum Anfang

alt Server Action

Rainoth
Moderator Off Offline

Zitieren
Hello all. Could someone make me an example of serveractions hook ?

I have such idea i u press serveraction 1 you get speed 50, If action 2 speed 100 and if action 3 then speed 0.

Thank you for your help.

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
batlaizys hat geschrieben
Hello all. Could someone make me an example of serveractions hook ?

I have such idea i u press serveraction 1 you get speed 50, If action 2 speed 100 and if action 3 then speed 0.

Thank you for your help.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("serveraction","test_act")
function test_act(id,b)
	if b==1 then
		menu(id,"Menu Name,button 1,button 2,button 3")
	end
end

addhook("menu","test_men")
function test_men(id,title,button)
	if title=="Menu Name" then
		if button==1 then
			parse("speedmod "..id.." 50")
		elseif button==2 then
			parse("speedmod "..id.." 100")
		elseif button==3 then
			parse("speedmod "..id.." 0")
		end
	end
end

or youdidnt mean an menu didnt u

heres the if you press F1 , F2 , F3

1
2
3
4
5
6
7
8
9
10
addhook("serveraction","test_act")
function test_act(id,b)
	if b==1 then
		parse("speedmod "..id.." 50")
	elseif b==2 then
		parse("speedmod "..id.." 100")
	elseif b==3 then
		parse("speedmod "..id.." 0")
	end
end

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
look b is like F2 , F3 , F4

if you have

1
if b==1 then

then its when you press F2

if you have

1
if b==2 then

then its when you press F3

if you have

1
if b==3 then

then its when you press F4

B 3 is the limit

alt Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Zitieren
Ok, if yuo can not say me how to make it:
Zitat
I need it to my script:
text of the high level (like leader in gun-game).
If i join i have level: -4 lvl's of leader.
If anybody get 20 level is message: msg("©000255000"..player(id,"name").." Has win the game!") and round restart.

•Levels + exp future
Spoiler >
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
level=initArray(32)
exp=initArray(32)

function level_hud(id)
parse('hudtxt2 '..id..' 1 "©000100255Level: '..level[id]..' " 13 117')
end

function exp_hud(id)
parse('hudtxt2 '..id..' 2 "©000100255Exp: '..exp[id]..'/8 " 13 129')
end

addhook("kill","ms_kill")
function ms_kill(id)
exp[id]=exp[id]+1
exp_hud(id)
if exp[id] == 8 then
exp[id]=0
level[id]=level[id]+1
msg2(id,"©000255000Level up!@C")
exp_hud(id)
level_hud(id)
end
end

addhook("spawn","ms_spawn")
function ms_spawn(id)
level_hud(id)
exp_hud(id)
end

Thanks in advance!
P.S: Sorry for my bad english


so, can you say how to make save and load for this script?
P.S: but if you can say how to make this (qoute) say plz!

alt Re: Lua Scripts/Questions/Help

head600
BANNED Off Offline

Zitieren
hi all i need this llua look all

if coming on server admin

right and up screen print

Online Admins:
-XXXXX
-XXXXX

or no online

Online Admins:
Nobody

make this with usgn

alt need?

CS2D_TURKEY
User Off Offline

Zitieren
please need


Server connecting ..

open automatic online radio player?



please make


i not maked

alt Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Zitieren
@CS2D_TURKEY you want music at join, right?
1
2
3
4
addhook("join","music_joi")
function music_joi(id)
	parse("sound2 "..id.. "..env/thats_the_way.wav")
end

file env/thats_the_way.wav is example. change it to your music.

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
CS2D_TURKEY hat geschrieben
no no

server connected and

background open website online radio playing?

please make


thats impossible

alt Re: Lua Scripts/Questions/Help

murilogc
User Off Offline

Zitieren
i want one script of classes ,

classes

Shop Owner (0/5)
Medic , if txt !gomedic , go to the medic (0/1)
Owner Hotel if txt !gohotel , go to the hotel (0/1)

and text !info show your profession

alt Re: Lua Scripts/Questions/Help

DannyDeth
User Off Offline

Zitieren
Hi, i was wondering if anyone has any ideas for admin codes. I built a map with a "Dunce box" in it for anyone that doesn't obey the rules. My code so far is this:
1
2
3
4
5
6
7
8
9
addhook ("say","tban")
function tban(p,txt)
	if (txt == "!tban "..id) then
		if (player(p, "name") == "DannyDeth") then
			parse("setpos "..id.." "..10.." "..10)
			msg(player(id, "name") .." has been temporarily placed in the dunce box as a result of their unorthodox behaviour")
		end
	end
end
Zum Anfang Vorherige 1 2234 235 236338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht