2009-04-29 01:58:41 +02:00
|
|
|
/*
|
|
|
|
* ============================================================================
|
|
|
|
*
|
|
|
|
* Zombie:Reloaded
|
|
|
|
*
|
2009-05-06 02:28:09 +02:00
|
|
|
* File: jumpboost.inc
|
|
|
|
* Type: Module
|
|
|
|
* Description: Modified jump vector magnitudes.
|
2009-04-29 01:58:41 +02:00
|
|
|
*
|
|
|
|
* ============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
2009-05-01 11:22:45 +02:00
|
|
|
}
|