Jump to content
UnDeaD.

AddEventHandler on Dedicated

Recommended Posts

Hello,

I have a few eventhandlers that I run on playable AI (and players) at mission start:

  • Hit
  • Killed
  • FiredMan

 

The problem I have is that these eventhadlers don't work for players on a dedicated server (and I think they wouldn't work for other players on a local server either). I know I have to play around with locality but I am not really familiar with that. I have read through some topics, but I couldn't get it to work. What i would like to achieve:

  • To run these eventhandlers, when a player joins and takes place of the playable AI.
  • To make the eventhandlers work for the AI, that takes control of the player's unit, when the player disconnects. (I can probably solve this with HandleDisconnect MEH. Tested: Not working).

 

I also have 2 questions:

  • Do the unit's  EHs get deleted/removed when the player "leaves it's body"?
  • How can I get the server to spawn a vehicle when the player's Killed EH triggers?

 

If anyone has some ideas, that would be great.

Share this post


Link to post
Share on other sites
14 hours ago, UnDeaD. said:

The problem I have is that these eventhadlers don't work for players on a dedicated server (and I think they wouldn't work for other players on a local server either). I know I have to play around with locality but I am not really familiar with that. I have read through some topics, but I couldn't get it to work. What i would like to achieve:

 

See the icon on each documented EH in the wiki. For example: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Hit That command requires arguments to be local. You need to check each EH/command like this so you know where it works and where it doesn't

hope that helps a little

  • Like 1

Share this post


Link to post
Share on other sites

Place all EH referring to players in initPlayerLocal.sqf

You can add a little condition inside a EH to remote it once the unit is no more player.

 

The units still exist when a player leaves.

You can create a vehicle by createVehicle . This command is EG so the vehicle is created for every PC. You can pass it to server by remoteExec it on server.

  • Like 1

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

×