Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
furikuri

Player position announced when a civilian is killed in multiplayer

Recommended Posts

I am using the following code to announce globally that a civilian has been killed. The mission is an adversarial with ambient civilians and a few that have been placed specifically. This is an updated version of my script because apparently the initial solution used code that would only work in singleplayer. I had a friend try and help me with this and while trying to move to MP friendly code it just kept giving me errors. I had some inspiration today and managed to get it working as intended again in the editor, but still nothing in MP.

This is in the init and ambient civilian module:

this addeventhandler ["killed",{_this execVM "playerposition.sqf"}];

This is the sqf:

//Scipt to announce player position in global

if (side (_this select 1) == west) then
{

_killer = _this select 1;

_pos = position _killer;
_pos = mapGridPosition _killer;


speaker globalchat format ["Civilian killing reported at %1",_pos];
};

The short version is.. How can I get player position in grid coordinates (4/6 digit hopefully) to be globally announced upon a blufor player killing a civilian?

Share this post


Link to post
Share on other sites

Wow, I feel silly for even posting now. I don't know how I overlooked the EH documentation. It works now, there are some minor things that I still need to sort out with it, but just getting it to post definitely helped.

Also yes my name is from FLCL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×