Left is negative , right is positive
PS : this idea is similar to call of duty advance warfare player boost jump
PHP Code:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Velocity By Side"
#define VERSION "1.0"
#define AUTHOR "Natsheh"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /goRight", "clcmd_right")
register_clcmd("say /goLeft", "clcmd_left")
}
public clcmd_right(id)
{
new Float:vVelo[3];
fm_velocity_byside(id, 400, vVelo)
set_pev(id, pev_velocity, vVelo)
client_print(id, print_chat, "* Boost Right.")
}
public clcmd_left(id)
{
new Float:vVelo[3];
fm_velocity_byside(id, -400, vVelo)
set_pev(id, pev_velocity, vVelo)
client_print(id, print_chat, "* Boost Left.")
}
/* Credits TO VEN */
stock fm_velocity_byside(index, multiplier, Float:velocity[3])
{
new Float:vec[3]
pev(index, pev_v_angle, vec)
engfunc(EngFunc_MakeVectors, vec)
global_get(glb_v_right, vec)
velocity[0] = vec[0] * multiplier
velocity[1] = vec[1] * multiplier
velocity[2] = vec[2] * multiplier
}
__________________