Jump to content
Sign in to follow this  
raidunalexo

Hitpart Modding

Recommended Posts

When I attach the event handler HitPart to an playable character it works first time but after it dies it disappears after respawning the character. I tried a respawn script to re attach the event handler to the new body that doesn't work either. Any help be appreciated.

Resolved the error. 
 
Thank You

Share this post


Link to post
Share on other sites

why you d'ont use a sqf init script for this?

 

_vehicle = _this select 0;
 
if(player in _vehicle)then{_vehicle = vehicle player;};
 
        _unit addEventHandler ["HandleDamage",{private["_unit","_hitpart"];
        _unit = _this select 0;
_hitpart = _this select 1;
_dam = _unit getHit _hitpart;
        
 
 
if((_dam < 1) and (_hitpart != "?") and (alive _unit)) exitwith {
        [_unit,_hitpart,_dam] exec "\script\myscript.sqs";
};
}];
 
you can launch this script in your init script [_vehicle] execvm "hitpart.sqf";
 
and this working after respawn ;)

Share this post


Link to post
Share on other sites

I might of forgot to mention that this was for Multiplayer but I figured it out using the [params, functionName, target, isPersistent, isCall] call BIS_fnc_MP; which was called when the player respawn it attaches the new scripts on all the computers, corpse had them removed. Works like a charm must be an internet game though

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×