Jump to content

How can i loop Eventhandlers


Leigham

Recommended Posts

im trying to create a script, i dont want to let anything out yet but i can get it to work once like this 

 

player addEventHandler ["fired", ["fired", {player setDamage 0.1;}];

 

 

but i was wondering if there was a way of setting that 0.1 damage per "fired"

Link to comment
Share on other sites

i was going to put a notification going into the safezone with player allowDamage false then another leaving the safezone with false, ive tried putting it in my mission.sqm but server wont launch, so was trying to do it in a script 

which i started here  reason why its not working ?

Link to comment
Share on other sites

i was going to put a notification going into the safezone with player allowDamage false then another leaving the safezone with false, ive tried putting it in my mission.sqm but server wont launch, so was trying to do it in a script 

which i started here  reason why its not working ?

Again, its epoch code that is resetting the allowDamage to true no matter what you do.

You have to find another route that I could not find.

The easy way is to just build the safe zones in the editor using the Epoch protection zones and I mean LOTS of them.

Mine are about 1200 to get at all 3 spawn points.

I believe I found the new server side update 0.2.5.2a locks out the server settings.pbo

Can anyone confirm this info?

I might post this question in its own thread.

Link to comment
Share on other sites

    BuiltVehicle addEventHandler ["HandleDamage",
    {
        _vehobj = _this select 0;
        _location = _this select 1;  // type string
        _damage = _this select 2;   // type number
        _sourceobj = _this select 3;
        _projectile = _this select 4; // type string
        //ASSERT this EH only active when vehicle owned by AI.
       if ( isNull _sourceobj) then
       {
            _damage = 0;
         //  diag_log format ["##VEHICLE DAMAGE: Reduced to ZERO ########"];
        };
        _damage       
    }];

Leigham,

  See the above code. I use this with AI controlled vehicles, so that when they crash into stuff (they are real shitty drivers) they don't go boom, but the vehicles can still be shot at.

 

You should be able to add this to all players when they enter a safe area. Obviously you will need to manipulate it some to get your desired effect.

 

This code runs client side.  

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...