Forum

> > CS2D > Scripts > Deagle HP Script Wrong
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Deagle HP Script Wrong

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Deagle HP Script Wrong

KaTiL
User Off Offline

Zitieren
What's wrong?
1
2
3
4
5
6
addhook('hit', 'hp')
function hp(id,wpn)
if wpn = 3 then
parse("sethealth "..id.." "..player(id,"health")+25)
end
end

>Help me

alt Re: Deagle HP Script Wrong

EngiN33R
Moderator Off Offline

Zitieren
1
2
3
4
5
6
addhook('hit', 'hp')
function hp(id,src,wpn)
if wpn = 3 then
parse("sethealth "..id.." "..player(id,"health")+25)
end
end

You have to keep the order of the arguments, if e.g. you have the arguments id,src,wpn you can't throw away src.

alt Re: Deagle HP Script Wrong

IWhoopedPythagoras
BANNED Off Offline

Zitieren
user EngiN33R hat geschrieben
1
2
3
4
5
6
addhook('hit', 'hp')
function hp(id,src,wpn)
if wpn = 3 then
parse("sethealth "..id.." "..player(id,"health")+25)
end
end

You have to keep the order of the arguments, if e.g. you have the arguments id,src,wpn you can't throw away src.


Don't forget the difference between = and ==. A beginner mistake that many people overlook.

alt Re: Deagle HP Script Wrong

EngiN33R
Moderator Off Offline

Zitieren
@IWhoopedPythagoras
Whoops, you're right, didn't see that. Thanks for fixing.

The final code:
1
2
3
4
5
6
7
addhook('hit', 'hp')
function hp(id,src,wpn)
	if wpn == 3 then
		parse("sethealth "..id.." "..player(id,"health")+25)
		return 1
	end
end

Spoiler >
2× editiert, zuletzt 07.07.11 22:52:45

alt Re: Deagle HP Script Wrong

Unknown_Soldier
User Off Offline

Zitieren
user EngiN33R, The final code is your first code with tabbing, the "==" mistake is still there

btw that script should heal your teammates (with Friendly fire off, since you can't damage allies) but will reduce the damage of the deagle if you shoot the enemy, I don't know what is the purpose of this script.

alt Re: Deagle HP Script Wrong

EngiN33R
Moderator Off Offline

Zitieren
I'm sorry Unknown, I'm malfunctioning when it gets midnight and when I only got 5 hours of sleep. I also put a return 1 to negate the actual hurting damage.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht