Raised This Month: $32 Target: $400
 8% 

Reflective grenades


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xTr3m3r
Member
Join Date: Feb 2010
Old 02-24-2017 , 07:08   Reflective grenades
Reply With Quote #1

Hi!

I was wondering if there is any existing Reflective Grenade plugin which makes HE/Flash or Smoke as a reflective ones which means when they are thrown at someone from the opposite team he gets pushed away? I searched a bit but couldn't find anything. Can somebody help me?
xTr3m3r is offline
clavificial
Junior Member
Join Date: Jan 2017
Old 02-24-2017 , 10:17   Re: Reflective grenades
Reply With Quote #2

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)
	}
}
clavificial is offline
xTr3m3r
Member
Join Date: Feb 2010
Old 02-25-2017 , 12:49   Re: Reflective grenades
Reply With Quote #3

Will this change the HE Grenade to a reflectable one or Flash or Smoke? How can I do it with Flash? but if its possible the flash will reflect but still have the flash effect.

Last edited by xTr3m3r; 02-25-2017 at 12:50.
xTr3m3r is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode