Forum

> > CS2D > General > Ammo,Medic kit lua script help !!
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Ammo,Medic kit lua script help !!

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt geschlossen Ammo,Medic kit lua script help !!

Maniek
User Off Offline

Zitieren
Hi


I want create a script.
When I hit machet on my position spawn primary ammo
When I hit claw on my position spawn medickit

Zitat
addhook("hit","cod4.health")
function cod4.health(id,source,wpn,hpdmg,apdmg)
if (wpn == 78) then
          parse("sethealth "..id.." "..player(id,"health")+5)
          return 1

end

addhook("hit","cod4.hit")
function cod4.hit(id)
if (wpn == 69) then
          parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."")
          parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."")
          return 1

end

end


what is wrong ??

alt Re: Ammo,Medic kit lua script help !!

mafia_man
User Off Offline

Zitieren
Are you know this thread ??
Lua Scripts/Questions/Help

You only spam !
post in Lua Scripts/Questions/Help thread and don't create new threads because it's spam and you can get ban

alt Re: Ammo,Medic kit lua script help !!

TimeQuesT
User Off Offline

Zitieren
there is no "end" for the function cod4.health.
just put it to he end of the function.
(yes that's spam pls wirte in the Lua Scripts/Questions/Help thread)
edit:you the console to debug!

alt Re: Ammo,Medic kit lua script help !!

GINO
BANNED Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
addhook("hit","cod4.health") 
function cod4.health(id,source,wpn,hpdmg,apdmg) 
if (wpn == 78) then 
          parse("sethealth "..id.." "..player(id,"health")+5) 
          return 1 

end 

addhook("hit","cod4.hit") 
function cod4.hit(id) 
if (wpn == 69) then 
          parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."") 
          parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."") 
          return 1 

end 

end
plz remove the doble end like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("hit","cod4.health") 
function cod4.health(id,source,wpn,hpdmg,apdmg) 
if (wpn == 78) then 
          parse("sethealth "..id.." "..player(id,"health")+5) 
          return 1
end 

addhook("hit","cod4.hit") 
function cod4.hit(id) 
if (wpn == 69) then 
          parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."") 
          parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."") 
          return 1 
end

alt Re: Ammo,Medic kit lua script help !!

ohaz
User Off Offline

Zitieren
No. The double end was right. But there was one missing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
addhook("hit","cod4.health")
function cod4.health(id,source,wpn,hpdmg,apdmg)
	if (wpn == 78) then
	parse("sethealth "..id.." "..player(id,"health")+5)
	return 1

	end
[b]end[/b]

addhook("hit","cod4.hit")
function cod4.hit(id)
	if (wpn == 69) then
	parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."")
	parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."")
	return 1

	end

end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht