Quantcast

Jump to content

» «
Photo

Fire Weapons

1 reply to this topic
arielnmz
  • arielnmz

    BlackHawk

  • Members
  • Joined: 17 Jun 2011

#1

Posted 08 January 2012 - 06:48 AM

Okay, I've been searching for a while but I just don't what I need...

What, or where can I find the correct function calls (with their params or at least some info) to fire the weapons?? For example:

If I want to "shoot" a rocket, I have to call 0x737C80 with 8 params: 0 4@ 1.0 8@ 7@ 6@ 19 0@, pop 8, and add this var to store some result: 1@. Something like this: 0AA7: call_function 0x737C80 params 8 pop 8 0 4@ 1.0 8@ 7@ 6@ 19 0@ 1@

But what about the other weapons? Or at least these: the AK47, the minigun, the chainsaw and the sawnoff...

I know you can help me... thanks biggrin.gif !!!

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci Racing
  • Joined: 24 Dec 2007
  • None

#2

Posted 08 January 2012 - 02:43 PM Edited by Deji, 08 January 2012 - 02:48 PM.

CWeapon::Fire - 0x742300

There are other related things. Can't be sure if they are called by CWeapon::Fire anyway or are called by something else (probably already called). But they could be useful if you need to only do certain parts of the gunshot...

CWeapon::DoBulletImpact - 0x73B550

A few functions call that. I think I identified one which is possibly for mounted guns on vehicles. You can start there to figure out what other steps to take including optionally using "?createLight" (0x7000E0) to create a gunfire flash effect and using particles to create a muzzle (or if you have an actual weapon created, you can also use the crappy DFF muzzle flash).

Also check out the code behind these opcodes:
CODE
06BC: create_M4_shoot_from 2193.268 -1165.441 1031.124 target $TEMPVAR_X_COORD $TEMPVAR_Y_COORD $TEMPVAR_Z_COORD energy 1
058A: create_gun_flash_from 2193.268 -1165.441 1031.124 to $TEMPVAR_X_COORD $TEMPVAR_Y_COORD $TEMPVAR_Z_COORD


You should document your finds for the good of future you and other modders tounge.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users