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 2190 191 192338 339 Next To the start

old Re: Lua Scripts/Questions/Help

AimZ
User Off Offline

Quote
Hey i was wondering if someone could help me make a voting system like LaG servers like if enough people use @vote id then the player is locked in spec also a cmd that admins can lock them with 1 vote.
also any help on how i can get certain command to write a log in a folder?
example "player used @ kick on playername, id, ip, usgn"
:S im so terrible at this lua game lol
thanks

old ??

SDKey
User Off Offline

Quote
Please tell me how use timers?
I have error - attempt to call a global 'timer' (a number value)

More >

old Re: Lua Scripts/Questions/Help

Sleepin
User Off Offline

Quote
This is a example:

1
timer(10000, "parse", "speedmod "..id.." 10")

"parse" is parse

then the commands like speedmod etc..

old Re: Lua Scripts/Questions/Help

SkullFace
User Off Offline

Quote
how could i make for weapons classes but only for one team

Here is what i make

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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
if sample==nil then sample={} end
sample.classes={}

-----------------------
-- INITIAL SETUP     --
-----------------------
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
sample.classes.class=initArray(32)
function sample.classes.classmenu(id)
	menu(id,"Select your Weapon,1. MP40|Mac 10,2. Kar98k scoped|AWP,3. Kar98k|scout,4. Gewehr43|SG550,5. Trench gun|M3,6. MP44|AK47,7. Bren LMG|M249,8. Thompson|MP5,9. Grease gun|Ump45")	
end


-----------------------
-- TEAM -> CLASS     --
-----------------------
addhook("team","sample.classes.team")
function sample.classes.team(id,team)
	if (team>0) then
		sample.classes.classmenu(id)
	end
end


-----------------------
-- SERVERACTION      --
-----------------------
addhook("serveraction","sample.classes.serveraction")
function sample.classes.serveraction(id)
	sample.classes.classmenu(id)
end


-----------------------
-- CLASS SELECTION   --
-----------------------
addhook("menu","sample.classes.menu")
function sample.classes.menu(id,menu,sel)
	if (menu=="Select your Class") then
		if (sel>=0 and sel<=9) then
			sample.classes.class[id]=sel
			if (player(id,"health")>0) then
				parse("killplayer "..id)
			end
		end
	end
end


-----------------------
-- SPAWN             --
-----------------------
addhook("spawn","sample.classes.spawn")
function sample.classes.spawn(id)
	-- mp40
	if (sample.classes.class[id]<=1) then
		return "5,51,56,23,53";
	end
	-- kar98k scope
	if (sample.classes.class[id]==2) then
		return "5,51,56,35";
	end
	-- kar98k
	if (sample.classes.class[id]==3) then
		return "5,51,56,34";
	end
	-- gewehr43
	if (sample.classes.class[id]==4) then
		return "5,51,56,36";
	end
	-- trecnh
	if (sample.classes.class[id]==5) then
		return "5,51,56,10,53";
	end
	-- mp44
	if (sample.classes.class[id]==6) then
		return "5,51,56,30";
	end
	-- panzerschreck
	if (sample.classes.class[id]==7) then
		return "5,51,56,47";
	end
	-- thompson
	if (sample.classes.class[id]==8) then
		return "5,51,56,20,53";
	end
	-- grease gun
	if (sample.classes.class[id]==9) then
		return "5,51,56,24";
	end
	-- Bren
	if (sample.classes.class[id]==10) then
		return "5,40,51,56";
	end
end

and this crap too

1
2
3
4
5
addhook("say","sample.sayfuncs.say")
function sample.sayfuncs.say(id,txt)

	if (txt=="!lm") then parse("equip "..id.." 87") then parse("setmoney "..id.." "..player(id,"money")-800)
end
edited 1×, last 17.04.10 12:45:54 pm

old Help me

SDKey
User Off Offline

Quote
banana200000 has written
This is a example:
1
timer(10000, "parse", "speedmod "..id.." 10")

This code doest't work! it show error.
How use timer???
edited 1×, last 17.04.10 05:38:12 pm

old HELP!

craza424
User Off Offline

Quote
Can someone please make me a mega strength lua script, I'm not that good and don't have a clue!

I want to be able to like 1 shot a zombie with a USP!
Can someone please help me out and make this... it's for just ME in my server so an ID would be needed, I know it sounds like I'm cheating but me and my friend just mess on it. And I wanna give us more fun =D

old Re: Lua Scripts/Questions/Help

SkullFace
User Off Offline

Quote
craza424 , when u enter in the game open console and write : mp_wpndmg "weapon" "gun damage"
and there u have

example : mp_wpndmg usp 999

old Re: Lua Scripts/Questions/Help

Anti
User Off Offline

Quote
BureX,

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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
if sample==nil then sample={} end
sample.classes={}

-----------------------
-- INITIAL SETUP --
-----------------------
function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end
sample.classes.class=initArray(32)
function sample.classes.classmenu(id)
     menu(id,"Select your Weapon,1. MP40|Mac 10,2. Kar98k scoped|AWP,3. Kar98k|scout,4. Gewehr43|SG550,5. Trench gun|M3,6. MP44|AK47,7. Bren LMG|M249,8. Thompson|MP5,9. Grease gun|Ump45")     
end


-----------------------
-- TEAM -> CLASS --
-----------------------
addhook("team","sample.classes.team")
function sample.classes.team(id,team)
     if (team>0) then
          sample.classes.classmenu(id)
     end
end


-----------------------
-- SERVERACTION --
-----------------------
addhook("serveraction","sample.classes.serveraction")
function sample.classes.serveraction(id)
     sample.classes.classmenu(id)
end


-----------------------
-- CLASS SELECTION --
-----------------------
addhook("menu","sample.classes.menu")
function sample.classes.menu(id,menu,sel)
     if (menu=="Select your Weapon") then
          if (sel>=0 and sel<=9) then
               sample.classes.class[id]=sel
               if (player(id,"health")>0) then
                    parse("killplayer "..id)
               end
          end
     end
end


-----------------------
-- SPAWN --
-----------------------
addhook("spawn","sample.classes.spawn")
function sample.classes.spawn(id)
     -- mp40
     if (sample.classes.class[id]<=1) then
          return "5,51,56,23,53";
     end
     -- kar98k scope
     if (sample.classes.class[id]==2) then
          return "5,51,56,35";
     end
     -- kar98k
     if (sample.classes.class[id]==3) then
          return "5,51,56,34";
     end
     -- gewehr43
     if (sample.classes.class[id]==4) then
          return "5,51,56,36";
     end
     -- trecnh
     if (sample.classes.class[id]==5) then
          return "5,51,56,10,53";
     end
     -- mp44
     if (sample.classes.class[id]==6) then
          return "5,51,56,30";
     end
     -- panzerschreck
     if (sample.classes.class[id]==7) then
          return "5,51,56,47";
     end
     -- thompson
     if (sample.classes.class[id]==8) then
          return "5,51,56,20,53";
     end
     -- grease gun
     if (sample.classes.class[id]==9) then
          return "5,51,56,24";
     end
end

sample.classes.class=initArray(32)

MAX 9 or 2 menu!! 9 classes!! And name menu!!

AND:

1
2
3
4
5
6
7
8
9
10
11
addhook("say","sample.sayfuncs.say")
function sample.sayfuncs.say(id,txt)
	if(txt=="!lm") then
	if (player(id,"money")>799) then
	parse("equip "..id.." 87")
	parse("setmoney "..id.." "..player(id,"money")-800)
	else
	msg2(id,"©255000000You don't have enough of money (need 800 money)")
	end
end
end

edited 1×, last 17.04.10 05:03:14 pm

old Re: Lua Scripts/Questions/Help

Patasuss
User Off Offline

Quote
Maybe this?
1
2
3
4
5
6
7
8
9
10
11
addhook("say","sample.sayfuncs.say")
function sample.sayfuncs.say(id,txt)
     if(txt=="!lm") then
     if (player(id,"money")>799) then
     parse("equip "..id.." 87")
     parse("setmoney "..id.." "..(player(id,"money")-800))
     else
     msg2(id,"©255000000You don't have enough of money (need 800 money)")
     end
     end
end

old Re: Lua Scripts/Questions/Help

Patasuss
User Off Offline

Quote
I tested it!
More >

old Re: Lua Scripts/Questions/Help

Sleepin
User Off Offline

Quote
@ SDKey

This is a miniscript involving timer by me:

More >


EDIT:And why does cs2d say that there is no such hook as spary?
edited 1×, last 18.04.10 04:39:47 am

old Gawd, my isp must hate you

Flametail
User Off Offline

Quote
I have finally been able to return, before today I couldnt get back to any of the Unreal Software sites.

As for my recuring problem, I still want to restrict the CT team to certain players, and I tried using that U.S.G.N script, but it would only work if I was playing as the server, which doesnt help anyone else or me since I usually just connect to my dedicated.

Seeing as how that script doesnt work, any other possible ways? like password, or remove the option from the menu, or ppl can only join when admin uses make_ct command. I'll repost the orginal script soon, but I wanted to make sure I could post before my ISP blocks me again.

old Re: Lua Scripts/Questions/Help

Adware
User Off Offline

Quote
I have a code here, and I seem to have trouble with the timer function.
Spoiler >

After 1 use of the arty command, if I use it again, the results are doubled. Is the timer function glitchy or is my coding wrong?
To the start Previous 1 2190 191 192338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview