Raised This Month: $51 Target: $400
 12% 

Catching flash blind event in module


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 06-29-2013 , 01:34   Catching flash blind event in module
Reply With Quote #1

Is there any reliable way to catch it?
__________________
youtube:
@holla16
11922911 is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 06-29-2013 , 07:45   Re: Catching flash blind event in module
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=215741

Hook ScreenFade and check color.
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-29-2013 , 07:55   Re: Catching flash blind event in module
Reply With Quote #3

A more reliable method would be to hook CBasePlayer::Blind() virtual function. But unless you explain what want to do, it may not.
__________________
Arkshine is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 06-29-2013 , 09:37   Re: Catching flash blind event in module
Reply With Quote #4

I want to make something like this plugin, but in module.

So which one should i use?
__________________
youtube:
@holla16

Last edited by 11922911; 06-29-2013 at 09:40.
11922911 is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-29-2013 , 20:59   Re: Catching flash blind event in module
Reply With Quote #5

This is the vtbl for CBasePlayer.
PHP Code:
struct _vt_CBasePlayer {
    
void (* CBasePlayer__Spawn)(_CBasePlayerself);
    
void (* CBasePlayer__Precache)(_CBasePlayerself);
    
void (* CBaseEntity__Restart)(_CBaseEntityself);
    
void (* CBaseMonster__KeyValue)(_CBaseMonsterselfKeyValueData_s*);
    
int (* CBasePlayer__Save)(_CBasePlayerself_CSave&);
    
int (* CBasePlayer__Restore)(_CBasePlayerself_CRestore&);
    
int (* CBasePlayer__ObjectCaps)(_CBasePlayerself);
    
void (* CBaseEntity__Activate)(_CBaseEntityself);
    
void (* CBaseEntity__SetObjectCollisionBox)(_CBaseEntityself);
    
int (* CBasePlayer__Classify)(_CBasePlayerself);
    
void (* CBaseEntity__DeathNotice)(_CBaseEntityselfentvars_s*);
    
void (* CBasePlayer__TraceAttack)(_CBasePlayerselfentvars_s*, floatVector&, TraceResult*, int);
    
int (* CBasePlayer__TakeDamage)(_CBasePlayerselfentvars_s*, entvars_s*, floatint);
    
int (* CBasePlayer__TakeHealth)(_CBasePlayerselffloatint);
    
void (* CBasePlayer__Killed)(_CBasePlayerselfentvars_s*, int);
    
int (* CBaseMonster__BloodColor)(_CBaseMonsterself);
    
void (* CBaseEntity__TraceBleed)(_CBaseEntityselffloatVector&, TraceResult*, int);
    
BOOL (* CBaseEntity__IsTriggered)(_CBaseEntityself_CBaseEntity*);
    
_CBaseMonster* (* CBaseEntity__MyMonsterPointer)(_CBaseEntityself);
    
_CBaseMonster* (* CBaseEntity__MySquadMonsterPointer)(_CBaseEntityself);
    
int (* CBaseToggle__GetToggleState)(_CBaseToggleself);
    
void (* CBasePlayer__AddPoints)(_CBasePlayerselfintint);
    
void (* CBasePlayer__AddPointsToTeam)(_CBasePlayerselfintint);
    
BOOL (* CBasePlayer__AddPlayerItem)(_CBasePlayerself_CBasePlayerItem*);
    
BOOL (* CBasePlayer__RemovePlayerItem)(_CBasePlayerself_CBasePlayerItem*);
    
int (* CBasePlayer__GiveAmmo)(_CBasePlayerselfintchar*, int);
    
float (* CBaseToggle__GetDelay)(_CBaseToggleself);
    
int (* CBaseEntity__IsMoving)(_CBaseEntityself);
    
void (* CBaseEntity__OverrideReset)(_CBaseEntityself);
    
int (* CBaseEntity__DamageDecal)(_CBaseEntityselfint);
    
void (* CBaseEntity__SetToggleState)(_CBaseEntityselfint);
    
void (* CBasePlayer__StartSneaking)(_CBasePlayerself);
    
void (* CBasePlayer__StopSneaking)(_CBasePlayerself);
    
BOOL (* CBaseEntity__OnControls)(_CBaseEntityselfentvars_s*);
    
BOOL (* CBasePlayer__IsSneaking)(_CBasePlayerself);
    
BOOL (* CBasePlayer__IsAlive)(_CBasePlayerself);
    
BOOL (* CBaseEntity__IsBSPModel)(_CBaseEntityself);
    
BOOL (* CBaseEntity__ReflectGauss)(_CBaseEntityself);
    
BOOL (* CBaseEntity__HasTarget)(_CBaseEntityselfunsigned int);
    
BOOL (* CBaseEntity__IsInWorld)(_CBaseEntityself);
    
BOOL (* CBasePlayer__IsPlayer)(_CBasePlayerself);
    
BOOL (* CBasePlayer__IsNetClient)(_CBasePlayerself);
    const 
char* (* CBasePlayer__TeamID)(_CBasePlayerself);
    
_CBaseEntity* (* CBaseEntity__GetNextTarget)(_CBaseEntityself);
    
void (* CBaseEntity__Think)(_CBaseEntityself);
    
void (* CBaseEntity__Touch)(_CBaseEntityself_CBaseEntity*);
    
void (* CBaseEntity__Use)(_CBaseEntityself_CBaseEntity*, _CBaseEntity*, USE_TYPEfloat);
    
void (* CBaseEntity__Blocked)(_CBaseEntityself_CBaseEntity*);
    
_CBaseEntity* (* CBaseEntity__Respawn)(_CBaseEntityself);
    
void (* CBaseEntity__UpdateOwner)(_CBaseEntityself);
    
BOOL (* CBasePlayer__FBecomeProne)(_CBasePlayerself);
    
Vector& (* CBaseEntity__Center)(_CBaseEntityself);
    
Vector& (* CBaseEntity__EyePosition)(_CBaseEntityself);
    
Vector& (* CBaseEntity__EarPosition)(_CBaseEntityself);
    
Vector& (* CBasePlayer__BodyTarget)(_CBasePlayerselfVector const&);
    
int (* CBasePlayer__Illumination)(_CBasePlayerself);
    
BOOL (* CBaseEntity__FVisible)(_CBaseEntityself_CBaseEntity*);
    
BOOL (* CBaseEntity__FVisibleVector)(_CBaseEntityselfVector const&);
    
void (* CBaseAnimating__HandleAnimEvent)(_CBaseAnimatingselfMonsterEvent_t*);
    
float (* CBaseMonster__ChangeYaw)(_CBaseMonsterselfint);
    
BOOL (* CBaseMonster__HasHumanGibs)(_CBaseMonsterself);
    
BOOL (* CBaseMonster__HasAlienGibs)(_CBaseMonsterself);
    
void (* CBaseMonster__FadeMonster)(_CBaseMonsterself);
    
void (* CBaseMonster__GibMonster)(_CBaseMonsterself);
    
Activity (* CBaseMonster__GetDeathActivity)(_CBaseMonsterself);
    
void (* CBaseMonster__BecomeDead)(_CBaseMonsterself);
    
BOOL (* CBasePlayer__ShouldFadeOnDeath)(_CBasePlayerself);
    
int (* CBaseMonster__IRelationship)(_CBaseMonsterself_CBaseEntity*);
    
void (* CBaseMonster__PainSound)(_CBaseMonsterself);
    
void (* CBasePlayer__ResetMaxSpeed)(_CBasePlayerself);
    
void (* CBaseMonster__ReportAIState)(_CBaseMonsterself);
    
void (* CBaseMonster__MonsterInitDead)(_CBaseMonsterself);
    
void (* CBaseMonster__Look)(_CBaseMonsterselfint);
    
_CBaseEntity* (* CBaseMonster__BestVisibleEnemy)(_CBaseMonsterself);
    
BOOL (* CBaseMonster__FInViewCone)(_CBaseMonsterself_CBaseEntity*);
    
BOOL (* CBaseMonster__FInViewCone2)(_CBaseMonsterselfVector*);
    
void (* CBasePlayer__Jump)(_CBasePlayerself);
    
void (* CBasePlayer__Duck)(_CBasePlayerself);
    
void (* CBasePlayer__PreThink)(_CBasePlayerself);
    
void (* CBasePlayer__PostThink)(_CBasePlayerself);
    
int (* CBasePlayer__GetGunPosition)(_CBasePlayerself);
    
int (* CBasePlayer__IsBot)(_CBasePlayerself);
    
void (* CBasePlayer__UpdateClientData)(_CBasePlayerself);
    
void (* CBasePlayer__ImpulseCommands)(_CBasePlayerself);
    
void (* CBasePlayer__RoundRespawn)(_CBasePlayerself);
    
void (* CBasePlayer__GetAutoaimVector)(_CBasePlayerself_CBasePlayerpOtherfloat fAngle);
    
void (* CBasePlayer__Blind)(_CBasePlayerselffloatfloatfloatint);
    
void (* CBasePlayer__OnTouchingWeapon)(_CBasePlayerself_CWeaponBox*);
}; 
You can hook Blind changing edict->pvPrivateData->vtable->Blind value to point to your custom function then you have to call the original Blind.

Also you can do hook/unhook over the function (symbol for linux: _ZN11CBasePlayer5BlindEfffi)

Prototype:
PHP Code:
void Blind(class CBasePlayer *const thisfloat durationfloat holdTimefloat fadeTimeint alpha); 
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 07-02-2013 , 01:36   Re: Catching flash blind event in module
Reply With Quote #6

Thanks for the info.
__________________
youtube:
@holla16
11922911 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:22.


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