Solved TINT TIME

Question that is answered or resolved.

O Ilusionista

Captain 100K
I am trying to adapt DC's tint method to a single didthitscript. It works okay, but I need to set it to expire after some time.
I've tried to use a counter but it doesn't works.

Code:
void main(){
	
	#define     EFFECT_TINT_BURN           rgbcolor (0, 101, 202)   // Burn color.
    #define     EFFECT_TINT_BURN_MODE      1                        // Burn tint alpha mode
	void ent = getlocalvar("damagetaker");
	int vtime = openborvariant("elapsed_time");
	
	changedrawmethod(ent, "enabled", 3);
	changedrawmethod(ent, "tintmode", EFFECT_TINT_BURN_MODE);
    changedrawmethod(ent, "tintcolor", EFFECT_TINT_BURN);
	
	if (vtime <= vtime + 200){
		changedrawmethod(ent, "tintmode",0);
		changedrawmethod(ent, "tintcolor", 0);
	}
}

once the entity who applies a didhitscript dies, the damagetaker variable is nullified?
 
That can never work, because didhitscript runs on the hit and never again. So there's nothing to monitor the time and take action when it expires.

User defined timers have to be run on a repetitious script event, like update, updated, ondraw, etc.

DC
 
Back
Top Bottom