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;
|
2009-05-10 18:49:47 +02:00
|
|
|
vecVelocity[2] += height;
|
2009-04-29 01:58:41 +02:00
|
|
|
|
|
|
|
JumpBoostSetClientVelocity(client, vecVelocity);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2009-05-10 18:49:47 +02:00
|
|
|
* Set new velocity on client. (Special method separate from ToolsClientVelocity)
|
2009-04-29 01:58:41 +02:00
|
|
|
*
|
|
|
|
* @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
|
|
|
}
|