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

46 lines
1.2 KiB
PHP
Raw Normal View History

2009-04-29 01:58:41 +02:00
/*
* ============================================================================
*
* Zombie:Reloaded
*
* 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);
}