Hi!
Try this
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#define PLUGIN "Grenade Reflection"
#define VERSION "1.337"
#define AUTHOR "Clavificial"
/**
*** CVAR:
*** amx_gren_push_mul "1.0" - Default 1.0. How much the player will be pushed back (the velocities will be multiplied by this amount)
*** amx_gren_push_ff "0" - Default 0. If you can push back teammates or not. 0 = off, 1 = on
**/
new pCvar_push_mul
new pCvar_push_ff
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
pCvar_push_mul = register_cvar("amx_gren_push_mul", "1.0")
pCvar_push_ff = register_cvar("amx_gren_push_ff", "0")
register_touch("player", "grenade", "fw_grenade_touch")
}
public fw_grenade_touch(player_id, grenade_id) {
//Check friendly fire
if(get_pcvar_num(pCvar_push_ff) == 1 || get_user_team(pev(grenade_id,pev_owner)) != get_user_team(player_id)) {
//Get grenade velocities
new Float:grenade_velocity[3]
pev(grenade_id, pev_velocity, grenade_velocity)
//Multiply velocities
new Float:push_mul = get_pcvar_float(pCvar_push_mul)
grenade_velocity[0] *= push_mul
grenade_velocity[1] *= push_mul
grenade_velocity[2] *= push_mul
//Set enemy player velocity
set_pev(player_id, pev_velocity, grenade_velocity)
}
}