歩行者設定

Last-modified: 2009-12-08 (火) 15:25:14

General
0xB6F5F0 - Player pointer (CPed)
0xB7CD98 - Player pointer, direct offset to the ped pool start (CPed)
0xB74498 - CPeds maximum number (normally 140)
0xB74490 - Contains a pointer to a pointer
This pointer:

  1. 0 = Contains a pointer to the first element in the pool
  2. 4 = Contains a pointer to a byte map indicating which elements are in use
  3. 8 = [dword] Is the maximum number of elements in the pool
  4. 12 = [dword] Is the current number of elements in the pool
    Each ped object is 1988 (0x7C4) bytes.

For each ped in the pool:

In most cases, you can use even the dword of playeraddress as CPed value

CPed +0x14 = Pointer to XYZ position structure (and rotation)
(CPed+0x14) +0x0 to +0x2C = [dword] Is the rotation matrix
(CPed+0x14) +0x30 = [dword] XPos
(CPed+0x14) +0x34 = [dword] YPos
(CPed+0x14) +0x38 = [dword] ZPos
CPed +0x2F = [byte] Location status:
0 = outside
3 = inside a building
CPed +0x42 = [float] Is the BP/EP/FP/DP (special flags) status of the player as follows:
Add these values, and write the sum into +66 (0x42).
1 = makes ped soft (ie. can move through walls and everything) (noclip in other words)
2 = freezes ped (ie. ped cannot walk)
4 = bullet-proof
8 = flame-proof
16 = ?
32 = ?
64 = damage-proof (from collisions etc)
128 = explosion-proof
CPed +0xC0 = [dword] Pointer to nearest car
CPed +0x15C = Some anim states:
0 = landing from jump
61 = punching
102 = stopped
154 = sprint
205 = run
Cped +0x46C = [byte] Player check:
0 = in air/water
1 = in car
2 = entering interior
3 = on foot
CPed +0x46D = Jump state:
32 = landed/idle
34 = in air
36 = landing
CPed +0x46F = Crouch state:
128 = stand
132 = crouched
CPed +0x474 = [byte] 透過性:
0 = 通常(可視)
14 = 透過(不可視)
CPed +0x47C = Pointer to anim struct
CPed +0x4DF = Current anim play-state:
0 = nothing
61 = starting/stopping
62 = looping
CPed +0x504 = [word] Muzzle flash intensity:
0 to 10000 = on
65536 = off
CPed +0x530 = [dword] State:
0 = leaving a car, falling down from a bike or something like this
1 = normal case
50 = driving
55 = wasted
63 = busted
CPed +0x534 = Runningstate:
0 = while driving
1 = standing still
4 = start to run
6 = running
7 = running fast (sprinting) by pressing sprint key
CPed +0x540 = [float] Health
CPed +0x544 = [float] Max health
CPed +0x548 = [float] Armor
CPed +0x558 = [float] Current rotation (Z angle)
CPed +0x55C = [float] Target rotation (Z angle)
CPed +0x560 = [float] Rotation speed (Z angle)
CPed +0x568 = [dword] Current Car you are in contact with
CPed +0x584 = [dword] Current Entity you are in contact with
CPed +0x58C = [dword] Last or Current Driven Car (CarPointer)
CPed +0x598 = [byte] PLayer lock (set to 1 to lock player controls, can't move)
CPed +0x5A0 = [byte] Start of weapon data (28 bytes) (See structures: WeaponSlot)
CPed +0x5D8 = [dword] Pistol weapon type:
22 = 9mm
23 = silenced 9mm
24 = desert eagle
CPed +0x5DC = [dword] Pistol state
CPed +0x5E0 = [dword] Pistol ammo in clip
CPed +0x5E4 = [dword] Pistol total ammo (including clip)
CPed +0x5F4 = [dword] Shotgun weapon type:
25 = shotgun
26 = sawn-off shotgun
27 = spas-12
CPed +0x5F8 = [dword] Shotgun state:
1 = firing?
2 = reloading
CPed +0x5FC = [dword] Shotgun ammo in clip
CPed +0x600 = [dword] Shotgun total ammo (including clip)
CPed +0x718 = [byte] Current weapon slot (1 byte)
CPed +0x740 = Current Weapon ID (from default.dat)
CPed +0x760 = [dword] Weapon you were killed with
CPed +0x764 = [dword] Pointer to the ped that killed you
Structures
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