AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved HAM hook grenade throwing (https://forums.alliedmods.net/showthread.php?t=319351)

Natsheh 10-26-2019 13:16

HAM hook grenade throwing
 
Is there anyway in ham module could detect grenade throwing I tried ham_spawn and entity grenade but it's too early for the checks..

CrazY. 10-31-2019 13:09

Re: HAM hook grenade throwing
 
FM_SetModel.

Natsheh 10-31-2019 16:45

Re: HAM hook grenade throwing
 
i can see you're not familiar with the caption >> Ham module << or atleast better way to hook grenade throw, i think best way will be using register_message and hooking the fire in the hole thing.

Bugsy 10-31-2019 18:25

Re: HAM hook grenade throwing
 
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);
}


Natsheh 10-31-2019 18:29

Re: HAM hook grenade throwing
 
Because I want to be able to disable the forward call

E1_531G 10-31-2019 20:11

Re: HAM hook grenade throwing
 
Quote:

Originally Posted by Natsheh (Post 2671524)
Because I want to be able to disable the forward call

You can disable FM_SetModel.

Bugsy 10-31-2019 22:47

Re: HAM hook grenade throwing
 
Yeah, what are you trying to block exactly, the throw or the set model?

HamletEagle 11-01-2019 03:22

Re: HAM hook grenade throwing
 
Quote:

Originally Posted by Natsheh (Post 2671524)
Because I want to be able to disable the forward call

You mean block the grenade from being thrown?

LearninG 11-01-2019 03:26

Re: HAM hook grenade throwing
 
he meant to use DisableHamForward() , i think.

RaZ_HU 11-01-2019 04:28

Re: HAM hook grenade throwing
 
Check this one, could be useful.


All times are GMT -4. The time now is 02:49.

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