Jump to content
Sign in to follow this  
luckyhendrix

Killed eventhandler and addaction in MP

Recommended Posts

hello ,

I making a MP mission where there's an hostage , I need to know who killed him

_Hostage = _this select 0;

_Killer = _select 1;

titleText [format["hostage killed by %1",_Killer], "PLAIN"];

I am using this now , but It don't work and I need it to work on either dedicated or local hosted server and I have no server to test it.

This hostage can't walk (I used the sethit command) and at the start of the mission he is on a Foldchair_with_cargo that is locked so he can't move.

On the chair I put this

myChair addaction ["Unlock Chair","Chairunlock.sqf",[],1,false,false,"","_this != hostage"]

ChairUnlock.sqf

_chair = _this select 0;

_caller = _this select 1;

_id = _this select 2;

_crew = crew _Chair;

_hotsage = _crew select 0;

_chair lock false;

unassignVehicle _Otage;

_hostage action ["GETOUT",_Chair];

_Chair removeAction _id;

_Chair addaction ["lock Chair","Chairlock.sqf",[],1,false,false,"","_this != Otage"];

hint "Chair unlocked";

Chairlock.sqf

_Chair = _this select 0;

_caller = _this select 1;

_id = _this select 2;

_Chair lock true;

if(hostage distance _Chair <5)then{

Hostage assignAsCargo _Chair;

Hostage moveincargo _Chair;

};

_Chair removeAction _id;

_Chair addaction ["Unlock Chair","Chairunlock.sqf",[],1,false,false,"","_this != Otage"];

hint "Chair locked";

On my local server that I host myself this works perfectely, I can force the hostage of getting of the chair then drag him out to another chair and put him back in.

But how will it perform on a dedicated server given that addaction is local ?

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  

×