CLEO Help Memory address for weapon speed?

CLEO related
Status
Not open for further replies.

Crayder

Active member
Joined
Mar 6, 2014
Messages
148
Reaction score
0
So for my adjustable rapid fire, I need a way to speed up sniper/c.rifle's. Seems to me the easiest way would be to keep the clip full or something, how would you guys do it?

I know using '0A8C' can modify weapon data, but what is the memory address for that?

According to gtamodding,
CPed +0x5A0 = [byte] Start of weapon data (28 bytes) (See structures: WeaponSlot)


WeaponSlot                // Total 28Bytes
DWORD      type          // + 0
DWORD      state        // + 4 (0 idle, 1 firing, 2 reloading)
DWORD      AmmoInClip    // + 8
DWORD      AmmoRemaining // +12
FLOAT      unknown      // +16 (increases each time you fire your weapon, 0 when weapon not active,
                              probably used to count bullets fired to know when to reload?)
UNKNOWN    0..7 Bytes    // +20 (unknown - goggle mode, 0 off and 256 on)...+27


WeaponSlot.type
  (Slot0: No Weapon)                    (Slot2: Handguns)
  0 - Fist                              22 - Pistol
  1 - Brass Knuckles                    23 - Silenced Pistol
  (Slot1: Melee)                        24 - Desert Eagle
  2 - Golf Club                        (Slot3: Shotguns)
  3 - Nitestick                          25 - Shotgun
  4 - Knife                              26 - Sawn-Off Shotgun
  5 - Baseball Bat                      27 - SPAS-12
  6 - Shovel                            (Slot4: Sub-Machineguns)
  7 - Pool Cue                          28 - Micro Uzi
  8 - Katana                            29 - MP5
  9 - Chainsaw                          32 - TEC-9
  15 - Cane
  (Slot5: Machineguns)                  (Slot10: Gifts)
  30 - AK47                              14 - Flowers
  31 - M4                                (Slot9:Special1)
  (Slot6: Rifles)                        42 - Fire Extinguisher
  33 - Country Rifle                    43 - Camera
  34 - Sniper Rifle                      (Slot11:Special2)
  (Slot7: Heavy Weapons)                44 - NV Goggles
  35 - Rocket Launcher                  45 - IR Goggles
  36 - Heat Seaking RPG                  46 - Parachute
  37 - Flame Thrower                    (Slot12:Detonators)
  38 - Minigun                            40 - Detonator(for remote explosives)
  (Slot8: Projectiles)
  16 - Grenade
  18 - Molotov Cocktail
  39 - Remote Explosives
  (No slot: Fired from hunter / hydra / missile launcher)
  (This type is stored in the rocket pool as rocket type, but is the continuation of this list)
  19 - Normal rockets
  20 - Heatseeking rockets
  58 - Flares
these are what I'm guessing would be used...
 

Crayder

Active member
Joined
Mar 6, 2014
Messages
148
Reaction score
0
Maybe I should mention that I do not want the thing to freeze the ammo, so I don't want ammo hacking... Also, I only need the sniper and rifle...
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
http://hotmist.ddo.jp/struct.html
weapon.dat

Start 0xC8AAB8
Size 0x70
Num 0x51

+0x00 DWord eFireType
+0x04 Float targetRange
+0x08 Float weaponRange
+0x0C Long modelId1
+0x10 Long modelId2
+0x14 DWord weaponslot
+0x18 DWord flags
+0x1C DWord AssocGroupId
+0x20 Word ammoClip
+0x22 Word damage
+0x24 Float fireOffset x
+0x28 Float fireOffset y
+0x2C Float fireOffset z
+0x30 DWord skillLevel
+0x34 DWord req stat level to get this weapon skill level
+0x38 Float accuracy
+0x3C Float move speed
+0x40 Float animLoop start / 30.0
+0x44 Float animLoop end / 30.0
+0x48 Float animLoop fire / 30.0
+0x4C Float animLoop2 start / 30.0
+0x50 Float animLoop2 end / 30.0
+0x54 Float animLoop2 fire / 30.0
+0x58 Float breakoutTime
+0x5C Float speed
+0x60 Float radius
+0x64 Float lifespan
+0x68 Float spread
+0x6C Byte AssocGroupId
+0x6D Byte Unknown 0
+0x6E Byte baseCombo
+0x6F Byte Unknown 1

Index 0 - 46 : Weapon 0 - 46 : Gangsta
Index 47 - 57 : Weapon 22 - 32 : Poor
Index 58 - 68 : Weapon 22 - 32 : Hitman
Index 69 : Weapon 22 : Cop


Code:
{$CLEO .cs}                
0000: NOP 
repeat
wait 50
until 0AFA:  is_samp_available

:First
wait 0
for 1@ = 22 to 33 
0AB1: @Increase_Shootrate 3 | -> Change Weapon 1@ Offset 0x40 SIZE_OF_DAT 4
0AB1: @Increase_Shootrate 3 | -> Change Weapon 1@ Offset 0x44 SIZE_OF_DAT 4
0AB1: @Increase_Shootrate 3 | -> Change Weapon 1@ Offset 0x48 SIZE_OF_DAT 4 //

0AB1: @Increase_Shootrate 3 | -> Change Weapon 1@ Offset 0x4C SIZE_OF_DAT 4
0AB1: @Increase_Shootrate 3 | -> Change Weapon 1@ Offset 0x50 SIZE_OF_DAT 4
0AB1: @Increase_Shootrate 3 | -> Change Weapon 1@ Offset 0x54 SIZE_OF_DAT 4 
end
0A93: end_custom_thread
jump @First

:Increase_Shootrate
0@ += 0x24 // UNKNOWN
0@ *= 0x70 // BLOCK SIZE
0@ += 0xC8AAB8 // BASE
005A: 0@ += 1@ // (int)
0A8D: 4@ = read_memory 0@ size 2@ virtual_protect 0
0AF8: samp add_message_to_chat "%f" color -1 4@
0013: 4@ *= 0.95
0A8C: write_memory 0@ size 2@ value 4@ virtual_protect 0
0AB2: ret 0 

0013: 4@ *= 0.95
The lower value of 4@ = the faster shooting rate, but it's very detectable because everyone around can see it somehow
 

Crayder

Active member
Joined
Mar 6, 2014
Messages
148
Reaction score
0
Doesn't the weapon.dat address affect everyone, so like when they are shooting you you are taking the rapid speed damage? That is not what I want if that is right. Also I don't think that would be synced, as weapon.dat is only client sided. If so, it will send bullet data faster but others will only see it regularly. Can someone confirm monday's method?
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
Crayder link said:
Doesn't the weapon.dat address affect everyone, so like when they are shooting you you are taking the rapid speed damage? That is not what I want if that is right. Also I don't think that would be synced, as weapon.dat is only client sided. If so, it will send bullet data faster but others will only see it regularly. Can someone confirm monday's method?
Yeha you are gonna get shot faster. But if its a Lagcomp ON server then u have a chance that every bullet will hit.
 
Status
Not open for further replies.
Top