Author Topic: Noob @ work: config should start script anytime  (Read 515 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Noob @ work: config should start script anytime
« on: 11 May 2008, 18:39:49 »
Okay, first i have to say, i'm complete new on the addon topic. Surely i've opened some config.cpp to look into them but honestly, they confused me more than they helped me.

About the problem:
My intention is to make (have) an addon which is always active (so no putting anything in the editor) which basically is a script which should run on clients. The script will adjust viewdistance according to players height above ground. So this should increase viewdistance if player is in a plane at high altitude. You may know this effect from ECS mod (didn't used any line of code of it, all made by myself).

I got it working with 2 downsizes:
It doesn't work if player is a editorplaced, siderelated plane/chopper with driver as pilot (BLUFOR/AIR/vehicle/ PLAYER AS PILOT). It works with UNIT and a EMPTY vehicle. I hope you see what a mean.
Second thing: it isn't extended Eventhandler compatible. If XEH is installed, my addon doesn't work.

So, if anyone could adjust my config.cpp to solve those 2 problems, i really would be happy.

Code: [Select]

This line
   #include "\Dta\STM_Dynamic_viewdistance.hpp"
will include the file which is meant for the player to be edited to set up min viewdistance and max viewdistance. This works fine.

This line
   init = "_this exec ""\STM_Dynamic_viewdistance\scripts\check.sqf""";
starts the script which checks if the local machine is player and if it's TRUE it will start the viewdistance script.

Anything else i have cluttered together from some other configs and may contain unneeded code. If so, please tell me what i can get rid off.

Problem solved and therefor topic is...

« Last Edit: 14 May 2008, 22:56:29 by myke13021 »