Raised This Month: $ Target: $400
 0% 

Solved HAM hook grenade throwing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-31-2019 , 18:25   Re: HAM hook grenade throwing
Reply With Quote #5

Why not use grenade_throw() in cstrike module?

Edit: I thought it was more intelligent, but it's just using SetModel
Code:
void SetModel_Post(edict_t *e, const char *m){

	if ( !isModuleActive() )
	{
		RETURN_META(MRES_IGNORED);
	}

	if ( e->v.owner && m[7]=='w' && m[8]=='_' ){
		int w_id = 0;
		CPlayer *pPlayer = GET_PLAYER_POINTER(e->v.owner);
		switch(m[9]){
		case 'h':
			w_id = CSW_HEGRENADE;
			g_grenades.put(e, 2.0, 4, pPlayer);
			pPlayer->saveShot(CSW_HEGRENADE);
			break;
		case 'f':
			if (m[10]=='l') w_id = CSW_FLASHBANG;
			break;
		case 's':
			if (m[10]=='m') w_id = CSW_SMOKEGRENADE;
			break;
		}
		if ( w_id )	
			MF_ExecuteForward( iFGrenade, static_cast<cell>(pPlayer->index), 
			static_cast<cell>(ENTINDEX(e)), static_cast<cell>(w_id));
	}

	RETURN_META(MRES_IGNORED);
}
__________________

Last edited by Bugsy; 10-31-2019 at 18:29.
Bugsy is offline
 



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 02:49.


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