Code:
damaged:
dmg_player=getsenderref();
dmg_source=getsourceref();
dmg=getparam(0);
if(GetParam(1) == 32) dmg=0;
if(getparam(1) == 64) dmg=0;
if(getcurweaponmode(getsenderref()) < 0)
{
dot=thingviewdot(getsenderref(), getsourceref());
factor=((dot*-1)+1)/2;
dmg=dmg*factor;
if(dmg < 1) dmg=0;
}
else
{
settimerex(0.1, 2, dmg, dmg_source);
}
ReturnEx(dmg);
Return;That handles blocking, where damage taken decreases the closer it is to Lvec.
Code:
touched:
sender=getsenderref();
source=getsourceref();
if(getcurweaponmode(sender) >= 0)
{
dot=thingviewdot(sender, source);
factor=((dot)+1)/2;
damage=15*factor;
damagething(source, damage, 0x10, sender);
}
return;This handles the attacking.
For some reason, when I try to damage the other player, it damages ME, in relation to HIS lvec. I can't figure out what's wrong or why it does this, any help would be appreciated.
That's seriously all I've changed in the cog, too.
------------------
Brutally honest since 1998