OFPEC Forum

Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Serial Killer on 02 Apr 2005, 17:11:59

Title: Script activated, when game starts...
Post by: Serial Killer on 02 Apr 2005, 17:11:59
What I have to do, if I want that some script, like Burn.sqs begins, when the game starts? I'm talking about addon's Init... You know?
Title: Re:Script activated, when game starts...
Post by: Planck on 02 Apr 2005, 17:55:25
As long as it is a mission editor placed addon you could use the 'init' eventhandler.

This would be defined in the config of said addon.


Planck
Title: Re:Script activated, when game starts...
Post by: Serial Killer on 02 Apr 2005, 18:01:21
Uhm.. You mean that I can put that in addon's config..? How? ???
Title: Re:Script activated, when game starts...
Post by: Planck on 02 Apr 2005, 18:18:34
Something along the lines of:

class EventHandlers
{
init = "(_this select 0) exec  {\mypbo\myscript.sqs}";
};

This of course is a subclass of your addons entry in cfgVehicles.

AFAIK the 'init' eventhandler does not work for .wrp placed objects though.


Planck
Title: Re:Script activated, when game starts...
Post by: Serial Killer on 03 Apr 2005, 09:51:56
Thank you! :D