Forum

> > CS2D > Scripts > Increase damage
Forums overviewCS2D overview Scripts overviewLog in to reply

English Increase damage

4 replies
To the start Previous 1 Next To the start

old Increase damage

illya
User Off Offline

Quote
Hi us.
Got problem.
I want make own mini super hero script not for publishing.
There a damn problem:
1
2
3
4
5
6
7
addhook("hit","hit")
function hit(id,source,weapon,hpdmg,apdmg)
if player(id,"usgn") == ***** then
hp = player(id,"health")-hpdmg-4
parse("sethealth "..source.." "..hp)
end
end
Player with usgn ***** must give more damage.
Skipping real damage vie "return 1".
I't dont work, why ?
Console is clear as my conscience

old Re: Increase damage

sixpack
User Off Offline

Quote
There is another why buy why you don't try increasing weapon's damage on attack, and set it back to normal when the attack is over?

old Re: Increase damage

DC
Admin Off Offline

Quote
Quote
Skipping real damage vie "return 1".

oh really? I don't see any return command in your script...
also you are confusing the IDs of the target (id) and the shooter (source) almost always! be careful!

old Re: Increase damage

Bowlinghead
User Off Offline

Quote
1
2
3
4
5
6
7
addhook("hit","hit")
function hit(id,source,weapon,hpdmg,apdmg)
if player(id,"usgn") == ***** then
hp = player(id,"health")-4 -- Anyway, the HPdamage is included. So you just need -4!
parse("sethealth "..id.." "..hp) -- What DC sayed: ID = Victim and Source=Attacker! So you have to type "id" not "source"!
end
end

old Re: Increase damage

DC
Admin Off Offline

Quote
this fix is still wrong. return 1 is still missing. you should subtract the hp as he did before and add a return 1 instead (causes half traffic of what you do).

also
1
if player(id,"usgn") == ***** then
is still using the id of the victim. that would mean that the user with this ID would be more vulnerable instead of causing more damage.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview