Page 1 of 1

Ok, now I'm stuck.

Posted: Sun Nov 19, 2006 9:41 pm
by Wertmanzzz
Hey there folks, I'm almost done with my headbangmod, only there's only 1 thing remaining, that's the damaging of the other player. :?
Here's what I want to do in words:

Code: Select all

killthread local.player:
headtrigger_# triggerable (make sure that it's triggerable)
if local.player exists
{
	wait until headtrigger_# is triggered.
                if local.player.state == "HEADBANG"
	{
		if headtrigger is touching an other human
		hurt the other human
                                wait until the headbang state is over
	}
}
end

(Headtrigger is the trigger attached to the head
Well do you guys have experience with this stuff??
Thanks already,
Wertmanzzz

Posted: Mon Nov 20, 2006 12:35 am
by Green Beret

Code: Select all

head_bang:

while(1) // put it in a loop so it runs all the time
{

for(local.i = 1;local.i <= $player.size;local.i++) // go through all the players
{
if(level.headbang[$player[local.i].dmteam] != NULL && level.headbang[$player[local.i].dmteam] != NIL) // if players team has a headbanger
{
if(vector_length ( $player[local.i].origin - level.headbang[$player[local.i].dmteam].origin ) < 25) // player must be within 25 units to be damaged
{
if($player[local.i].health  1)
{
$player[local.i] volumedamage 15
}
}
}
}
waitframe
}
end
I did not test this :wink:

Posted: Tue Nov 21, 2006 10:35 am
by Wertmanzzz
Srry m8, didnt work :(