Hi
Is anyone up to a bit of a scripting challenge?
This has got me beat, and I suspect it may have to involve public event handlers.
Public event handlers confuse the crap out of me, no matter how much I try to read about them.
In this PBO: http://www.mediafire.com/?b9n7e9xjc1tjbz6 I have five terrorists that will get shot.
Once someone approaches the dead body, they can use the action menu to identify the terrorist that has been shot. On identification a hint appears naming the dead terrorist and the killer. In the task list the terrorist gets marked off as killed.
So what is happening is that an 'MPEventHandler' sets off a script when the terrorist is killed.
This is the MPEventHandler:
This is the script that gets run:Code:this addMPEventHandler [""mpkilled"", {T1K = _this select 1; nul=[]exec ""T1Action.sqf""}]
The script does an 'AddAction' to the dead body so that "Identify body" turns up in the action menu when the body is approached.Code:if (!isServer) exitWith {}; _a2=T1 addaction ["<t color = '#F7FE2E'>Identify body</t>", "T1.sqf"];
Running the action sets off a second script:
Works great in testing with one player, but as soon as it's served up to more players, it all turns to custard.Code:if (!isServer) exitWith {}; objT1 setTaskState "SUCCEEDED"; hint format["Boris Zaitsev successfully eliminated by %1",T1K]; T1K addRating 1000; T1 removeAction 0;
"Identify body" appears in the action menu multiple times.
Only the person who executes the action sees the hint and gets the green task success.
Any help would be greatly appreciated.
HOME
Reply With Quote



