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 260 61 62338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
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
3× editiert, zuletzt 29.09.09 09:06:17

alt Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Zitieren
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]

alt Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
LinuxGuy hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Zitieren
Flacko hat geschrieben
LinuxGuy hat geschrieben
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?

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
LinuxGuy hat geschrieben
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.

alt Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Zitieren
Blazzingxx hat geschrieben
LinuxGuy hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
LinuxGuy hat geschrieben
Flacko hat geschrieben
LinuxGuy hat geschrieben
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...

alt Re: Lua Scripts/Questions/Help

PlayerNoob
User Off Offline

Zitieren
Homer hat geschrieben
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....
1× editiert, zuletzt 30.09.09 07:16:48

alt Re: Lua Scripts/Questions/Help

RAVENOUS
BANNED Off Offline

Zitieren
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 <.<

alt Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Zitieren
@ 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

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
redefinder hat geschrieben
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.

alt Re: Lua Scripts/Questions/Help

Steroid
User Off Offline

Zitieren
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
3× editiert, zuletzt 01.10.09 15:56:26

alt Re: Lua Scripts/Questions/Help

New Rex
User Off Offline

Zitieren
Adamexxo-FraG hat geschrieben
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.

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
New Rex hat geschrieben
Adamexxo-FraG hat geschrieben
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

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Flacko hat geschrieben
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!
Zum Anfang Vorherige 1 260 61 62338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht