Jump to content

Set vehicle damage


7katwoal12

Recommended Posts

hello i was working and i have lost the code wich made a car spawn with damaged doors and windows. it was done with nativefunction. can someone help me? i have decompied my own code wich contains that part. here it is:

NativeFunction.CallByName<uint>("SMASH_VEHICLE_WINDOW", new NativeArgument[2]
      {
        NativeArgument.op_Implicit((IHandleable) this.victim),
        NativeArgument.op_Implicit(0)
      });
      NativeFunction.CallByName<uint>("SMASH_VEHICLE_WINDOW", new NativeArgument[2]
      {
        NativeArgument.op_Implicit((IHandleable) this.victim),
        NativeArgument.op_Implicit(1)
      });
      NativeFunction.CallByName<uint>("SMASH_VEHICLE_WINDOW", new NativeArgument[2]
      {
        NativeArgument.op_Implicit((IHandleable) this.victim),
        NativeArgument.op_Implicit(-1)
      });
      NativeFunction.CallByName<uint>("SET_VEHICLE_DOOR_OPEN", new NativeArgument[4]
      {
        NativeArgument.op_Implicit((IHandleable) this.victim),
        NativeArgument.op_Implicit(5),
        NativeArgument.op_Implicit(true),
        NativeArgument.op_Implicit(true)
      });
      NativeFunction.CallByName<uint>("SET_VEHICLE_DOOR_OPEN", new NativeArgument[4]
      {
        NativeArgument.op_Implicit((IHandleable) this.victim),
        NativeArgument.op_Implicit(3),
        NativeArgument.op_Implicit(true),
        NativeArgument.op_Implicit(true)
      });

 

Link to comment
Share on other sites

  • 3 months later...

You could use this to get back on track on your project, you should be able to figure out what goes where from this =) .

 

Door indexes: 

 

0 = Front Left, //Front left window

1 = Front Right, //Front right window

2 = Back Left, //Middle left window

3 = Back Right, //Middle right window

4 = Hood, //Back left window

5 = Trunk //Back right window

6 = Toggle Extra //Windscreen

7 = Toggle Extra //Back window

 

Door indexes also go in the same pattern as vehicle seats, but - 1. For example, index -1 is the driver, but index 0 is the passenger. This is the same case for all "normal" cars (What I mean by that is, if the car has extra seats, you need to check the VehicleSeat enum).

 

The natives you need/used:

void SET_VEHICLE_DOOR_OPEN(Vehicle vehicle, int doorIndex, BOOL loose,   BOOL openInstantly)

void SMASH_VEHICLE_WINDOW(Vehicle vehicle, int index)

 

Your topic does unfortunately look like a case of code theft so you're going to have to figure out the other stuff out yourself 😃

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...