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 260 61 62338 339 Next To the start

old Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Quote
Someone help me with this:

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
if tgne==nil then tgne={} end
tgne.test={}
minute = 0
parse("sv_gamemode 3")
addhook("spawn","tgne.test.spawn")
addhook("minute","tgne.test.minute")
addhook("build","tgne.test.site")
addhook("build","tgne.test.sitenow")

function tgne.test.minute()
   minute = minute+1
	if (minute == 5) then
	msg ("©128000000 This is an official Construction Server!")
	msg("©128000128 Official [CM] Clan Dedi")
      end
	if (minute == 3) then
	msg ("©000000128 This construction server is powered by [CM]CmDark.")
end

function tgne.test.spawn()
	return "58,74"
end   


parse("mp_building_limit Turret 9999")
parse("mp_building_limit Supply 9999")
parse("mp_building_limit Dispenser 9999") 
lim = 'mp_building_limit "%s" 9999' 
parse (lim:format("Gate Field"))  
parse (lim:format("Wall I")) 
parse (lim:format("Wall II"))
parse (lim:format("Wall III"))
parse (lim:format("Teleporter Entrance"))
parse (lim:format("Teleporter Exit"))
parse (lim:format("Barricade"))
parse (lim:format("Barbed Wire"))


function tgne.test.site(id,type)
	if (type == 21) then
		return 0
	else
		return 1
	end
end


function tgne.test.sitenow(id,type,x,y)
	if (type == 21) then
		return 0
	else
		parse("spawnobject "..type.." "..x.." "..y.." 90 1 "..player(id,"team").." "..id)
	end
end

Help ASAP please.. i wanna open my dedi when i get home tmrow

Why do i need to end function
edited 3×, last 29.09.09 09:06:17 am

old Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Quote
if you indent your code correctly, you would've easily spotted the mistake

1
2
3
4
5
6
7
8
9
[b]function[/b] tgne.test.minute() 
	minute = minute+1 
	if (minute == 5) then 
		msg ("©128000000 This is an official Construction Server!") 
		msg("©128000128 Official [CM] Clan Dedi") 
	end 
	if (minute == 3) then 
		msg ("©000000128 This construction server is powered by [CM]CmDark.") 
	end

Just add an end at the end of the tgne.test.minute function.

1
2
3
4
5
6
7
8
9
10
[b]function[/b] tgne.test.minute() 
	minute = minute+1 
	if (minute == 5) then 
		msg ("©128000000 This is an official Construction Server!") 
		msg("©128000128 Official [CM] Clan Dedi") 
	end 
	if (minute == 3) then 
		msg ("©000000128 This construction server is powered by [CM]CmDark.") 
	end 
[b]end[/b]

old Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Quote
i couldn't help it, but i just noticed that you used my script and just changed names.
or im blind?

yeez, my script is getting popular with ppl here

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
LinuxGuy has written
i couldn't help it, but i just noticed that you used my script and just changed names.
or im blind?

yeez, my script is getting popular with ppl here


I don't think that's good. Dx

old Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Quote
Flacko has written
LinuxGuy has written
i couldn't help it, but i just noticed that you used my script and just changed names.
or im blind?

yeez, my script is getting popular with ppl here


I don't think that's good. Dx

why not?

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
LinuxGuy has written
couldn't help it, but i just noticed that you used my script and just changed names.
or im blind?
yeez, my script is getting popular with ppl here

Dont start that, becouse I would say to you same thing.
You are not the first one who made it , however its simple script whitch can make everyone without help.

old Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Quote
Blazzingxx has written
LinuxGuy has written
couldn't help it, but i just noticed that you used my script and just changed names.
or im blind?
yeez, my script is getting popular with ppl here

Dont start that, becouse I would say to you same thing.
You are not the first one who made it , however its simple script whitch can make everyone without help.

didnt stated anything. but just i couldn't help myself with that site and sitenow name.
thus, that proves nothing, and youre right, its just a simple script witch everyone can make. i just said about the names

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
LinuxGuy has written
Flacko has written
LinuxGuy has written
i couldn't help it, but i just noticed that you used my script and just changed names.
or im blind?

yeez, my script is getting popular with ppl here


I don't think that's good. Dx

why not?


Because some assholes will think they are smart by just renaming variable names and reuploading the script saying that they did all the work.
But I'm not really sure if this is the case...

old Re: Lua Scripts/Questions/Help

PlayerNoob
User Off Offline

Quote
Homer has written
lim = 'mp_building_limit "%s" 5'
parse (lim:format("Gate Field"))
what does this mean?



EDITED:
It sets Gate Field Building limit to 5.

1
parse ("mp_building_limit \"Gate Field\" 5")

Also works....
edited 1×, last 30.09.09 07:16:48 am

old Re: Lua Scripts/Questions/Help

RAVENOUS
BANNED Off Offline

Quote
A problem with this script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("startround","skipper")
	function skipper(id)
		skipperi=math.random(3)
			if(skipperi==1) then
				if(player(i,"exists")) then
					parse("equip "..i.." 69"
				end
			elseif(skipperi==2) then
				if(player(i,"exists")) then
					parse("equip "..i.." 73"
				end
			elseif(skipperi==3) then
				if(player(i,"exists")) then
					parse("equip "..i.." 87"
			end
		end
	end

Problem is, that he says something about a "bad argument" - I don't understand that <.<

old Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Quote
@ Skipper

I fixed it and it works. It gave me a molotov and when i killed myself, it gave me machete

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("startround","skipper")
function skipper(id)
skipperi=math.random(3)
	for i=1,32 do
		if(skipperi==1) then
			if(player(i,"exists")) then
				parse("equip "..i.." 69")
			end
		elseif(skipperi==2) then
			if(player(i,"exists")) then
				parse("equip "..i.." 73")
			end
		elseif(skipperi==3) then
			if(player(i,"exists")) then
				parse("equip "..i.." 87")
			end
		end
	end
end

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Can anyone tell me how to make more classes.I made 9 classes in a script and i don`t know how to make more.Anyone please tell me how to make more classes.I used this code:
1
Code
adm.classes.class=initArray(32)
function adm.classes.classmenu(id)
     menu(id,"Select your Class,Policeman|USP,Scientist|Glock,Banker|Five Seven,Builder|Wrench,Street Racer|Speed,Terrorist|AK47,American Soldier|m4a1,Spy|Stealth,Swat|Light Armor")
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
redefinder has written
Can anyone tell me how to make more classes.I made 9 classes in a script and i don`t know how to make more.Anyone please tell me how to make more classes.I used this code:
1
Code
adm.classes.class=initArray(32)
function adm.classes.classmenu(id)
     menu(id,"Select your Class,Policeman|USP,Scientist|Glock,Banker|Five Seven,Builder|Wrench,Street Racer|Speed,Terrorist|AK47,American Soldier|m4a1,Spy|Stealth,Swat|Light Armor")
end


You can't place more than 9 buttons in a single Lua menu, try using different pages.

old Re: Lua Scripts/Questions/Help

Steroid
User Off Offline

Quote
im new srcipter and i need help with my map script

1
2
3
4
5
6
7
8
9
10
11
12
addhook("startround","snowball_spawn
function snowball_spawn(weapon)
if(weapon == 75) then
     parse ("spawnitem 75 24 14")
end

addhook("hit","Snowball_respawn") 
function Snowball_respawn(weapon) 
if(weapon == 75) then 
     parse ("spawnitem 75 24 14")) 
end 
end

plz fix it
edited 3×, last 01.10.09 03:56:26 pm

old Re: Lua Scripts/Questions/Help

New Rex
User Off Offline

Quote
Adamexxo-FraG has written
im new srcipter and i need help with my map script

1
2
3
4
5
6
7
8
9
10
11
12
addhook("startround","snowball_spawn[u][b]"[/b][/u]
function snowball_spawn(weapon)
if(weapon == 75) then
     parse ("spawnitem 75 24 14")
end

addhook("hit","Snowball_respawn") 
function Snowball_respawn(weapon) 
if(weapon == 75) then 
     parse ("spawnitem 75 24 14")) 
end 
end

plz fix it


Didn't you miss that "?
I recommend you and all to use SCiTE, it's a great Lua tool. It beats Komodo.
Notepad sucks.

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
New Rex has written
Adamexxo-FraG has written
im new srcipter and i need help with my map script

1
2
3
4
5
6
7
8
9
10
11
12
addhook("startround","snowball_spawn[u][b]"[/b][/u][u])[/u]
function snowball_spawn(weapon)
if(weapon == 75) then
     parse ("spawnitem 75 24 14")
end

addhook("hit","Snowball_respawn") 
function Snowball_respawn(weapon) 
if(weapon == 75) then 
     parse ("spawnitem 75 24 14")) 
end 
end

plz fix it


Didn't you miss that "?
I recommend you and all to use SCiTE, it's a great Lua tool. It beats Komodo.
Notepad sucks.


If you use SciTE, you should know about it's brace matching function, use it

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Flacko has written
Quote
You can't place more than 9 buttons in a single Lua menu, try using different pages.

Yes i know,i was asking if anyone could tell me how to make more classes by making different pages with next.PLEASE HELP!
To the start Previous 1 260 61 62338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview