Forum

> > CS2D > Scripts > i am newbie, need advice!
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch i am newbie, need advice!

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt i am newbie, need advice!

unknown soldier
User Off Offline

Zitieren
Hi all.
I am a newbie in scripting. So I need help. So here it is:

-i need a healing system. +5 health point per second.
-i need a hurt message health at 30 show a message
"You are hurt, get to cover!"
-i need a kind of weapon selection (example)
-CT:
- PPS43
- mosin-nagnat
- SVT40
- scoped mosin-nagnat
- PPSH-42

-T
- MP40
- kar98k
- gewehr 43
- scoped kar98k
- MP44

Can anyone tell me how to do it?

If yes thank you
*will be nice if a professional script maker give me a advice

alt Re: i am newbie, need advice!

Reaper
User Off Offline

Zitieren
You should just check the file archive, there you will find pretty much everything you need. Addionally you can search the internet for some lua basic tutorials:

Btw, if you would have spent 2 seconds for search you would have found http://www.unrealsoftware.de/files_show.php?file=8888 for sure. Also the other stuff is pretty basic, I think there are already some default lua scripts which come with the game, which fit your needs. Haven't installed the game at the moment, but I'm pretty damn sure about it, so just check the sys/lua folder.

alt Re: i am newbie, need advice!

Gajosik
BANNED Off Offline

Zitieren
Health script:
1
2
3
4
5
addhook('second','gajospl_second')
function gajospl_second(id)
local heal=player(id,"health")
parse('sethealth '..id..' '..heal..'+5')
end
I'm user Gaios
I am writing from my brother's account.

I do not know if that works. I am writing from Android

alt Re: i am newbie, need advice!

Avo
User Off Offline

Zitieren
1
2
3
4
5
addhook('second','gajospl_second')
function gajospl_second(id)
local heal=player(id,"health")
parse('sethealth '..id..' '..heal..'+5')
end
Fails. Hook "second" does not work with id argument. parse('sethealth '..id..' '..heal..'+5') won't work, becouse with cs2d console can't use math operations.
1
2
3
4
5
6
7
addhook('second','boltpl_second')
function boltpl_second()
	for _,id in pairs(player(0,"tableliving")) do 
		local hp=player(id,"health")+5
		parse('sethealth '..id..' '..hp)
	end
end

alt Re: i am newbie, need advice!

ExecL
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook('second','boltpl_second')
function boltpl_second()
     for _,id in pairs(player(0,"tableliving")) do 
          local hp=player(id,"health")+5
          parse('sethealth '..id..' '..hp)
     end
		for _,id in pairs(player(0,"tableliving")) do 
				local hp2=player(id,"health")
				if hp2 < 41 then
			msg2(id,"©255000000You are hurt, get to cover!")
		end
	end
end

Lol.

alt Re: i am newbie, need advice!

unknown soldier
User Off Offline

Zitieren
Thank you for your all help sir.
I apologize for my rudeness. Because I am not good at english too.

@bolt_pl (no, sir I am not doing COD5 sir. I just want to test my scripting abilities, and I am about test in cod2 it lot easier.
lol
1× editiert, zuletzt 02.09.12 18:16:07

alt Re: i am newbie, need advice!

unknown soldier
User Off Offline

Zitieren
Addhook("spawn", "stalingrad")
Function stalingrad(Id)
If player(Id,"team") == 1 then
Menu(Id,"select weapon,scoped kar98k|get.")
Elseif player(I'd, "team") == 2 then
Menu(Id,"select weapon,scoped mosin-nagnat|get.")
End
End
Should script like this?

alt Re: i am newbie, need advice!

Jynxxx
User Off Offline

Zitieren
Like this, learn how to not capitalize anything important like
addhook, function, end, if, elseif, else
1
2
3
4
5
6
7
8
addhook("spawn","stalingrad")
function stalingrad(id)
	if player(id,"team") == 1 then
		menu(id,"select weapon,scoped kar98k|get.")
	elseif player(id,"team") == 2 then
		Menu(id,"select weapon,scoped mosin-nagnat|get.")
	end
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht