sm-zombiereloaded-3/src/zr/jumpboost.inc

45 lines
1.1 KiB
PHP
Raw Normal View History

2009-04-29 01:58:41 +02:00
/*
* ============================================================================
*
* Zombie:Reloaded
*
* File: jumpboost.inc
* Description: Modified jump vector magnitudes.
*
* ============================================================================
*/
/**
* Client is jumping.
*
* @param client The client index.
*/
JumpBoostOnClientJump(client)
{
// Get class jump multipliers.
new Float:distance = ClassGetJumpDistance(client);
new Float:height = ClassGetJumpHeight(client);
// Get client's current velocity.
new Float:vecVelocity[3];
ToolsClientVelocity(client, vecVelocity, false);
// Apply jump values.
vecVelocity[0] *= distance;
vecVelocity[1] *= distance;
vecVelocity[2] = height;
JumpBoostSetClientVelocity(client, vecVelocity);
}
/**
* Apply jump boost force on client. (Special method separate from ToolsClientVelocity)
*
* @param client The client index.
* @param vecVelocity Velocity to set on client.
*/
JumpBoostSetClientVelocity(client, const Float:vecVelocity[3])
{
SetEntDataVector(client, g_iToolsBaseVelocity, vecVelocity, true);
}