Posts
167
Respect
44Add +1
Forum Rank
Pack-a-Puncher
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!Callback_PlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime )
{
//CODER MOD: TOMMY K, this is to prevent a player killing another player
if( isdefined( eAttacker ) && isPlayer( eAttacker ) && ( !isDefined( level.friendlyexplosivedamage ) || !level.friendlyexplosivedamage ))
{
if( self != eAttacker )
{
//one player shouldn't damage another player, grenades, airstrikes called in by another player
return;
}
else if( sMeansOfDeath != "MOD_GRENADE_SPLASH"
&& sMeansOfDeath != "MOD_GRENADE"
&& sMeansOfDeath != "MOD_EXPLOSIVE"
&& sMeansOfDeath != "MOD_PROJECTILE"
&& sMeansOfDeath != "MOD_PROJECTILE_SPLASH"
&& sMeansOfDeath != "MOD_BURNED" )
{
//player should be able to damage they're selves with grenades and stuff
//otherwise don't damage the player, so like airstrikes won't kill the player
return;
}
}
if( isDefined( eAttacker ) && isPlayer( eAttacker ) )
{
if( eAttacker meleeButtonPressed() )
{
self setVelocity( vectorToAngles( eAttacker.origin - self.origin ) ); // Not tested, you'll have to play around with this. Most likely won't push the player in the correct direction.
self setMoveSpeedScale( .3 );
wait( 1 );
self setMoveSpeedScale( 1 );
}
if( eAttacker attackButtonPressed() )
{
self setMoveSpeedScale( .3 );
wait( 1 );
self setMoveSpeedScale( 1 );
}
}
// Override MUST call finishPlayerDamage if the damage is to be applied
if( IsDefined( level.overridePlayerDamage ) )
{
self [[level.overridePlayerDamage]]( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
return;
}
self finishPlayerDamageWrapper( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
} if( isDefined( eAttacker ) && isPlayer( eAttacker ) )
{
if( eAttacker meleeButtonPressed() )
{
self setVelocity( vectorToAngles( eAttacker.origin - self.origin ) ); // Not tested, you'll have to play around with this. Most likely won't push the player in the correct direction.
self setMoveSpeedScale( .3 );
wait( 1 );
self setMoveSpeedScale( 1 );
}
if( eAttacker attackButtonPressed() )
{
self setMoveSpeedScale( .3 );
wait( 1 );
self setMoveSpeedScale( 1 );
}
}