Quantcast

Jump to content

» «
Photo

Documenting GTA-SA memory adresses

1,322 replies to this topic
MindF*ck
  • MindF*ck

    ...

  • Members
  • Joined: 03 Jul 2005

#1081

Posted 30 March 2010 - 09:29 AM

QUOTE (DexX @ Mar 30 2010, 02:11)
QUOTE
One little insight from a (vehicle-)modders view though.
There is actually no fourth carcol ingame.

Oh it's there, and it works. I used it on my escalade. From the San Andreas Vehicle Tech Doc;

QUOTE
Using Carcol materials on your model
Set the diffuse color of your material to one of the following colors, to have its color ingame, controlled by the carcols.dat file.
QUOTE

RGB colors for each carcol color:
Primary - 60, 255, 0 - This color
Secondary- 255, 0, 175 - This color
Third - 0 255, 255 - This color
Fourth - 255, 0, 255 - This color

To use the third and 4th colors, you need to put your vehicle in the "car4" section, at the end of your carcols.dat file.

Always read the pinned topics. I posted that info in 2006 tounge.gif

The function for checking if a material is carcols-compatible is at 0x004C8220. The first argument the RpMaterial* to check, the second argument is some user-supplied data.

Color indices for current vehicle being processed;
0x00B4E3F0 - car color index for primary color
0x00B4E3F1 - car color index for secondary color
0x00B4E3F2 - car color index for third color
0x00B4E3F3 - car color index for fourth color

The actual array of carcol colors is at 0x00B4E480
There's space allocated for 128 colors (at 4 bytes per color, though alpha isn't used), although it would probably be possible to create a new array of colors, and modify the game to point to the new array. You'd have to update the carcols.dat file though to actually set the extra colors to a non-zero value, and actually have vehicles that use the new colors. You'd still be limited to 256 colors though, unless you changed the indices at B4E3F0x to use something with a larger storage capacity. This is all completely untested of course.

0x00B4E688 - pointer to vehicle.txd
0x00B4E68C - pointer to vehiclelightson128 texture
0x00B4E690 - pointer to vehiclelights128 texture

holy sh*t, that actually really works! I guess I have to say thank you!
Funny though, that I asked about this fourth carcol several times on different forums and noone could ever help me.
And also that actually noone (besides you, I suppose) has ever used this on any carmod biggrin.gif

About the actual carcols, I've seen several modders adding new colors in the carcols.dat. They seem to work just by adding them to the file, without an intense modding like pointing to a new array or something. How does the game handle those? Does it just overwrite the values that are stored after the allocated carcols array? Now that would lead to the assumption, that some other gamedata is overwritten by those new colors ... right?

gtamaster1990
  • gtamaster1990

    Player Hater

  • Members
  • Joined: 21 Oct 2009

#1082

Posted 02 April 2010 - 03:36 PM

Is there a memory address that holds the IDirect3D9 object created by Direct3DCreate9() ?

gtamaster1990
  • gtamaster1990

    Player Hater

  • Members
  • Joined: 21 Oct 2009

#1083

Posted 02 April 2010 - 05:25 PM

Is there a memory address that holds the IDirect3D9 object created by Direct3DCreate9() ?

DexX
  • DexX

    Black Hat

  • Feroci Racing
  • Joined: 16 May 2002

#1084

Posted 02 April 2010 - 08:43 PM

Yes, and there's more than one way to get the object. What do you need to do with it? Renderware maintains an internal cache of the common d3d stuff, and accessing it directly invalidates the cache. For most of the common d3d functionality, there's an equivalent Rw function for accessing it without screwing anything up.

Addresses;
0x00C97C20 __RwDirect3DObject
0x00C97C28 __RwD3DDevice

I used this for sagfx;
HRESULT hr;
IDirect3D9* d3dObject = 0;
IDirect3DDevice9* sadevice = 0;

//RwD3D9GetCurrentD3DDevice is at 0x007F9D50, and returns a void pointer
sadevice = (IDirect3DDevice9*)_RwD3D9GetCurrentD3DDevice();//will invalidate the device cache!
hr = sadevice->GetDirect3D(&d3dObject);

@ Mindf*ck;
I haven't tried any of those carcol mods, so i'm not sure how they work, or what the game does internally. I usually only work with the default game files.

gtamaster1990
  • gtamaster1990

    Player Hater

  • Members
  • Joined: 21 Oct 2009

#1085

Posted 03 April 2010 - 11:17 AM

Thanks that was exactly what i was searching.

4elovek_paket
  • 4elovek_paket

    Player Hater

  • Members
  • Joined: 08 Apr 2010

#1086

Posted 08 April 2010 - 10:30 AM

Can anyone help me? How can I see the texture on the screen that it was in the background and did not cover on-screen elements? And how to change the coordinates of the camera on the player?

m0niSx
  • m0niSx

    Player Hater

  • Members
  • Joined: 15 May 2010

#1087

Posted 15 May 2010 - 12:15 PM Edited by m0niSx, 16 May 2010 - 03:56 PM.

hi, is there anyway to check if the GTA:SA game is started or not ?
i mean exactly if the loading part is end and the player is playing, not if the game is launched or not
EDIT: solution found smile.gif

XX3
  • XX3

    MTA Gamer!

  • Members
  • Joined: 25 Sep 2009

#1088

Posted 13 June 2010 - 02:40 PM

I need to ask a question:
What's the adress for getting the oxygen value? You know what that means, diving.
Sorry if I interrupt you guys (or bump)

Silent
  • Silent

    Moderating Cookie Monster

  • Members
  • Joined: 01 Feb 2010
  • Poland

#1089

Posted 27 June 2010 - 06:29 PM

My small finds:

0xB70154 [byte] - current month day
0xB70155 [byte] - current month

Used by opcode 0835.

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#1090

Posted 03 July 2010 - 06:35 PM Edited by Wesser, 28 December 2011 - 11:36 AM.

QUOTE (ceedj @ Dec 22 2007, 06:24)
0x53EAD3 - Call RenderCrosshairs (NOP 5 bytes to disable)

No more green crosshairs! Also disables the rocket target as well.

0x58E020 - DrawCrosshairs func
0x58FBBF - Call DrawCrosshairs (NOP 5 bytes)

Noping this function it should remove ONLY the crosshairs and nothing more instead.

Since there's no reference about how to hook a simple cheat, I'll try to explain this a-bit-unnecessary procedure. Firstly, let me show you where all cheats are located.

0x8A5B58 - [dword] Cheats base address
0x8A5CC8 - [dword] Hash cheats base address

Each cheat call/hash has 4 bytes. To retrieve the cheat number just divide the offset by 4 (useful for 0x438370, thanks to SilentPL).

OffsetDescriptionCheat stringHash stringCall
+ 0x0Weapon Set 1LXGIWYL0xDE4B237DYes
+ 0x4Weapon Set 2KJKSZPJ0xB22A28D1Yes
+ 0x8Weapon Set 3UZUMYMW0x5A783FAEYes
+ 0xCHealth, Armor, $250kHESOYAM0xEECCEA2BYes
+ 0x10Add 2 wanted startsOSRBLHH0x42AF1E28Yes
+ 0x14Clear wanted levelASNAEB0x555FC201Yes
+ 0x18Sunny weatherAFZLLQLL0x2A845345Yes
+ 0x1CVery sunny weatherICIKPYH0xE1EF01EAYes
+ 0x20Overcast weatherALNSFMZO0x771B83FCYes
+ 0x24Rainy weatherAUIFRVQS0x5BF12848Yes
+ 0x28Foggy weatherCFVFGMJ0x44453A17Yes
+ 0x2CFaster clockYSOHNUL0xFCFF1D08No
+ 0x30Faster gameplayPPGWJHT0xB69E8532Yes
+ 0x34Slower gameplayLIYOAAY0x8B828076Yes
+ 0x38Peds attack other with golfclubAJLOJYQY0xDD6ED9E9Yes
+ 0x3CHave a bounty on your headBAGOWPG0xA290FD8CYes
+ 0x40Everyone armedFOOOXFT0x3484B5A7No
+ 0x44Spawn RhinoAIWPRTON0x43DB914EYes
+ 0x48Spawn Bloodring BangerCQZIJMB0xDBC0DD65Yes
+ 0x4CSpawn RancherJQNTDMH0x0Yes
+ 0x50Spawn Hotring APDNEJOH0xD08A30FEYes
+ 0x54Spawn Hotring BVPJTQWV0x37BF1B4EYes
+ 0x58Spawn RomeroAQTBCODX0xB5D40866Yes
+ 0x5CSpawn StretchKRIJEBR0xE63B0D99Yes
+ 0x60Spawn TrashmasterUBHYZHQ0x675B8945Yes
+ 0x64Spawn CaddyRZHSUEW0x4987D5EEYes
+ 0x68Blow up all carsCPKTNWT0x2E8F84E8Yes
+ 0x6CInvisible carXICWMD0x1A9AA3D6No
+ 0x70Perfect handlingPGGOMOY0xE842F3BCNo
+ 0x74SuicideSZCMAWO0x0D5C6A4EYes
+ 0x78All green lightsZEIIVG0x74D4FCB1No
+ 0x7CAggressive driversYLTEICZ0xB01D13B8No
+ 0x80Pink trafficLLQPFBN0x66516EBCYes
+ 0x84Black trafficIOWDLAC0x4B137E45Yes
+ 0x88Drive on water-0x0No
+ 0x8CBoats flyAFSNMSMW0x78520E33No
+ 0x90Fat playerBTCDBCB0x3A577325Yes
+ 0x94Max muscleJYSDSOD0xD4966D59Yes
+ 0x98Skinny playerKVGYZQK0x5FD1B49DYes
+ 0x9CElvis is everywhereASBHGRB0xA7613F99Yes
+ 0xA0Peds attack you with rocketsBGLUAWML0x1792D871Yes
+ 0xA4Beach partyCIKGCGX0xCBC579DFYes
+ 0xA8Gang members everywhereMROEMZH0x4FEDCCFFYes
+ 0xACGangs controls the streetsBIFBUZZ0x44B34866Yes
+ 0xB0Ninja themeAFPHULTL0x2EF877DBYes
+ 0xB4Slut magnetBEKKNQV0x2781E797Yes
+ 0xB8Cheap trafficBGKGTJH0x2BC1A045Yes
+ 0xBCFast trafficGUSNHDE0xB2AFE368Yes
+ 0xC0Cars flyRIPAZHA0xFA8DD45BNo
+ 0xC4Huge bunny hopJHJOECW0x8DED75BDNo
+ 0xC8Spawn HydraJUMPJET0x1A5526BCYes
+ 0xCCSpawn VortexKGGGDKP0xA48A770BYes
+ 0xD0Smash n' boomJCNRUAD0xB07D3B32No
+ 0xD4All cars have nitroCOXEFGU0x80C1E54BNo
+ 0xD8Cars float away when hitBSXSGGC0x5DAD0087No
+ 0xDCAlways midnightXJVSNAJ0x7F80B950Yes
+ 0xE0Stop game clock orange skyOFVIAC0x6C0FA650Yes
+ 0xE4Thunder stormMGHXYRM0xF46F2FA4Yes
+ 0xE8Sand stormCWJXUOC0x70164385Yes
+ 0xEC--0x0Yes
+ 0xF0Mega jumpLFGMHAL0x885D0B50No
+ 0xF4Infinite healthBAGUVIX0x151BDCB3No
+ 0xF8Infinite oxygenCVWKXAM0xADFA640ANo
+ 0xFCHave parachuteAIYPWZQP0xE57F96CEYes
+ 0x100Have getpackYECGAA0x40CF761Yes
+ 0x104Never wantedAEZAKMI0xE1B33EB9Yes
+ 0x108Six wanted starsLJSPQK0xFEDA77F7Yes
+ 0x10CMega punchIAVENJQ0x8CA870DDNo
+ 0x110Never get hungryAEDUWNV0x9A629401No
+ 0x114Riot modeIOJUFZN0xF53EF5A5Yes
+ 0x118Funhouse themePRIEBJ0xF2AA0C1DYes
+ 0x11CAdrenaline modeMUNASEF0xF36345A8Yes
+ 0x120Infinite ammoWANRLTW0x8990D5E1No
+ 0x124Weapon aiming while drivingOUIQDMW0xB7013B1BYes
+ 0x128Reduced trafficTHGLOJ0xCAEC94EENo
+ 0x12Ccountry trafficFVTMNBZ0x31F0C3CCYes
+ 0x130Recruit anyone (9mm)SJMAHPE0xB3B3E72ANo
+ 0x134Country cars and pedsBMTPWHR0xC25CDBFFNo
+ 0x138Recruit anyone (rockets)ZSOXFSQ0xD5CF4EFFNo
+ 0x13CMax respectOGXSDAG0x680416B1No
+ 0x140Max sex appealEHIBXQS0xCF5FDA18No
+ 0x144Max staminaVKYPQCF0xF01286E9Yes
+ 0x148Hitman level for all weaponsNCSGDAG0xA841CC0AYes
+ 0x14CMax driving skillsVQIMAHA0x31EA09CFYes
+ 0x150Spawn HunterOHDUDE0xE958788AYes
+ 0x154Spawn QuadAKJJYGLC0x2C83A7CYes
+ 0x158Spawn Tanker TruckAMOMHRER0xE49C3ED4Yes
+ 0x15CSpawn DozerEEGCYXT0x171BA8CCYes
+ 0x160Spawn Stunt PlaneURKQSRK0x86988DAEYes
+ 0x164Spawn MonsterAGBDLCID0x2BDD2FA1Yes
+ 0x168Prostitutes pay you-0x0No
+ 0x16CTaxi have nitrous-0x0No

It's possible to hook a cheat by:
  • Redirecting it's call to a nop function but still working
  • Changing it's hash string
As regards the farmer, we have to change the cheat call address and make it reading a no-operation-function (which is a cheat function as well):
CODE
// HESOYAM cheat no effect
0A8C: write_memory 0x8A5B64 size 4 value 0x4395A0 virtual_protect 0 // 0x8A5B58 + 0x3 * 4

The latter just requires to modify the hash string into a weird input cheat:
CODE
// no more HESOYAM cheat
0A8C: write_memory 0x8A5CD4 size 4 value 0xFFFFFFFF virtual_protect 0 // 0x8A5CC8 + 0x3 * 4

This is an example using CLEO:
CODE

{$CLEO}

0000: NOP

// disable HESOYAM cheat
0A8C: write_memory 0x8A5CD4 size 4 value 0xFFFFFFFF virtual_protect 0

while true
 wait 0
 0@v = "GIVEMEHEALTHARMO"
 4@v = "URANDALOTOFMONEY"
 if
 0AB1: call_scm_func @testCheat 8 string 0@ 1@ 2@ 3@ 4@ 5@ 6@ 7@
 then
   03E5: show_text_box "CHEAT1"
   // give full health
   0A96: 0@ = actor $PLAYER_ACTOR struct
   0@ += 0x544
   0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0 // get player max health
   0@ -= 0x4
   0A8C: write_memory 0@ size 4 value 1@ virtual_protect 0 // set player max health
   // give full armour
   0945: get_player $PLAYER_CHAR max_armour_to 2@
   0093: 2@ = integer 2@ to_float
   0@ += 0x8
   0A8C: write_memory 0@ size 4 value 2@ virtual_protect 0 // set player armour
   // give $250,000
   0109: player $PLAYER_CHAR money += 250000
 end
end

:getLocalVarOffset
{
 Parameters:
   Passed:
     0@ - thread pointer
     1@ - var number
   Result:
     1@ - var value

 Example:
   0AB1: call_scm_func @getLocalVarOffset 2 thread 0@ var 0 store_to 1@
}
if
 0@ <> 0
then
 1@ *= 0x4
 0A8E: 2@ = 0@ + 0xDC // mission flag
 if
   2@ == 1
 then
   1@ += 0xA48960 // mission locals
 else
   005A: 1@ += 0@
   1@ += 0x3C
 end
else
 1@ = 0
end
0AB2: ret 1 1@

:getStringLen
{
 Parameters:
   Passed:
     0@ - string value
   Result:
     4@ - string length

 Example:
   0AB1: call_scm_func @getStringLen 1/4 string 0@/3@ store_to 4@
}
0A9F: 4@ = current_thread_pointer
0AB1: call_scm_func @getLocalVarOffset 2 thread 4@ var 0 store_to 5@
6@ = 0
while true
 0A8D: 7@ = read_memory 5@ size 1 virtual_protect 0
 if and
   7@ > 0
   6@ < 0x10 // 16 bytes
 then
   5@ += 0x1
   6@ += 1
 else
   if
     6@ == 0
   then
     059A: return_false
     0AB2: ret 1 0
   else
     break
   end
 end
end
0485: return_true
0AB2: ret 1 6@

:testCheat
{
 Parameters:
   Passed:
     0@ - string value
   Result:
     none

 Example:
   0AB1: call_scm_func @testCheat 1/8 string 0@/7@
}
0A9F: 8@ = current_thread_pointer
0AB1: call_scm_func @getLocalVarOffset 2 thread 8@ var 0 store_to 9@
0AB1: call_scm_func @getStringLen 4 string 0@ 1@ 2@ 3@ store_to 10@
0AB1: call_scm_func @getStringLen 4 string 4@ 5@ 6@ 7@ store_to 11@
005A: 11@ += 10@
005A: 9@ += 11@
15@ = 0x969110 // keypresses buffer
0085: 14@ = 15@
while 10@ > 0
 9@ -= 0x1
 0A8D: 12@ = read_memory 9@ size 1 virtual_protect 0 // last cheat char
 0A8D: 13@ = read_memory 14@ size 1 virtual_protect 0 // last pressed key
 // LowerCase -> UpperCase
 if
   12@ >= 0x61
   12@ <= 0x7A
 then
   12@ -= 0x32
 end
 if
 803B:  12@ <> 13@
 then
   059A: return_false
   0AB2: ret 0
 end
 14@ += 0x1
 10@ -= 1
end
0A8C: write_memory 15@ size 1 value 0 virtual_protect 0
0485: return_true
0AB2: ret 0

This is the script which takes part of the whole code. Learn there how to create new cheats. wink.gif

"Drive on water" (+ 0x22) cheat has been removed in PC version and can be enabled with the following code line:
CODE
0A8C: write_memory 0x8A5D50 size 4 value 0x12EDB9AF virtual_protect 0

Then type GALILE while ingame (thanks to fastman92).

Accidently, I found out a small trick which can be used to enable the "Drive on water cheat" available for console version only:
CODE
0A8C: write_memory 0x8A5D14 size 4 value 0xFFFFFFFF virtual_protect 0

It replaces the "Spawn Rancher" cheat, so type JQNTDMH to enable/disable it.

After these explanations which hopefully helps, I have more questions indeed: how to convert or retrieve the cheat string from a hash code and which is its type? CRC32? If so, would you be so kind to teach me how to do it?

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009

#1091

Posted 08 August 2010 - 02:15 PM

Can someone find the following adresses:
- Limit, how many entries of each group in cargrp.dat can be loaded.
Because game scans each group in cargrp.dat and loads car entries. But there limit about 20-25 cars (suposedly number). So you can`t add too many cars to GTA SA game, cuz they can be spawned, but they don`t go on the street.
- Limit, how many COL Files can be loaded from IMG archives. Limit is accurately 254 COL Files. When amount of COL files will increase to 255 or higher game will crash during 50% loading.

Breaking these limits will be helpful to many people modding GTA SA, I think.

spaceeinstein
  • spaceeinstein

    巧克力

  • Members
  • Joined: 17 Jul 2003

#1092

Posted 09 August 2010 - 01:58 AM

There's no practical way to increase the COL limit. I don't have experience in SA but in VC each car color is 1 byte long. THe largest value it can have is "FF" (255). There are too many references to getting and setting car colors that I think is not worth the trouble trying to extend the limit.

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009

#1093

Posted 09 August 2010 - 10:09 AM

QUOTE
setting car colors

I guess, you don`t know what I want. I wrote nothing about hacking carcols.dat limit, but HOW MANY .col files can be exist in IMG archives. COL files aren`t colors of cars. COL files (collisions) are mainly used as related to new buildings. Currently we can add only 3 new COL files to IMG archive. When we add 4 files or more, game will crash.

spaceeinstein
  • spaceeinstein

    巧克力

  • Members
  • Joined: 17 Jul 2003

#1094

Posted 09 August 2010 - 11:15 AM

catspider.gif Slap me for misunderstanding. The carcol had almost the same limitation. Did you try the Limit Adjuster?

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009

#1095

Posted 10 August 2010 - 01:46 PM

Yes, I tried SA Limit Adjuster (I changed and unhashes collision related values), but it didn`t help.

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#1096

Posted 19 August 2010 - 05:21 PM Edited by Wesser, 06 March 2011 - 11:18 AM.

While finding something useful in 06BC opcode offset, I noticed this function for getting the collision point between 2 points:

0x56BA00 : GetCollisionBetweenPoints(float *vecOrigin, float *vecTarget, float *vecPoint, DWORD *dwEntity, bool bSolid, bool bCar, bool bActor, bool bObject, bool bParticle, bool bIgnoreSeeThroughStuff, bool bIgnoreSomeObjectsForCamera, bool bIgnoreShootThroughStuff)

Example here.

Programie
  • Programie

    Programmer & Memoryhacker

  • Members
  • Joined: 15 Aug 2007
  • Germany

#1097

Posted 22 August 2010 - 11:44 AM

Is there a way to respawn the player like in SA-MP?
If I set the gravity very high or very low, I see the "Loading..." message. I tried to reset the gravity and kill the player but nothing happens.
If I do the same in SA-MP (Set the gravity very high or very low and then reset the gravity and kill the player), it works: I get respawned and can continue play normally.

How does SA-MP handle that?

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#1098

Posted 26 August 2010 - 02:25 PM Edited by Wesser, 27 August 2010 - 07:24 AM.

Here is a little useful trick to retrieve any model licence plate text:

0xB1F650 : Base Memory Address
+ 0x4 - Start of CModelCars (size = 0x282A0)
    + 0x308 : Block Size (for each vehicle defined in vehicles.ide)
      + 0x28 - Contains a pointer
        + 0x0 - Pointer to CModelBase
          + 0x10 - License Plate Text (8-byte string)
CODE

{
 FUNCTIONS INCLUDED:

-   getModelLcPlate
     Type: GET
       Description: Get model licence plate text.
}

{$CLEO}

0000: NOP

03F0: enable_text_draw 1

while true
 wait 0
 if
 00DF:  actor $PLAYER_ACTOR driving
 then
   03C0: 1@ = actor $PLAYER_ACTOR car
   0441: 0@ = car 1@ model
   0AB1: call_scm_func @getModelLcPlate 1 model 0@ store_to 1@ 2@
   // now 1@s will contain our 8-byte string
 end
end

:getModelLcPlate
{
 Parameters:
   Passed:
     0@ - vehicle model
   Result:
     1@/2@ - plate text

 Example:
   0AB1: call_scm_func @getModelLcPlate 1 model #LANDSTAL store_to 1@ 2@
}
0@ -= 400
0@ *= 0x308
0@ += 0xB1F650 // CModelCars
0@ += 0x28
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 // CModelBase
0@ += 0x10
0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0 // License Plate Text
0@ += 0x4
0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0
0AB2: ret 2 1@ 2@

Those set by SCM will be skipped.

Note: License plate textes are genereted as early as a vehicle model is loaded. Unfortunately, the game sets them once so we will notice vehicles with same plates. confused.gif

-ATP-
  • -ATP-

    GTA United Leading Developer

  • Members
  • Joined: 10 Oct 2009

#1099

Posted 21 September 2010 - 07:03 PM

Is it possible to check if any key is pressed? It doesn´t matter to me which one it is.

Silent
  • Silent

    Moderating Cookie Monster

  • Members
  • Joined: 01 Feb 2010
  • Poland

#1100

Posted 21 September 2010 - 07:34 PM

Hmm, why not use 0AB0 CLEO opcode?

-ATP-
  • -ATP-

    GTA United Leading Developer

  • Members
  • Joined: 10 Oct 2009

#1101

Posted 21 September 2010 - 07:45 PM

QUOTE (SilentPL @ Sep 21 2010, 19:34)
Hmm, why not use 0AB0 CLEO opcode?

Because I have to check 100 keys then, to check if any key is pressed.

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#1102

Posted 22 September 2010 - 01:12 PM Edited by Wesser, 22 September 2010 - 02:54 PM.

This is my work about virtual keys. It's one of dozen files I made to be included in my sources. Maybe I'll share all of them and make you contribute on improving this project, just like a SDK for SA coding. smile.gif

However, you can avoid that by checking every virtual key pressed using 0AB0 as follows:
CODE

{$CLEO}

0000: NOP

while true
 wait 0
 if
 0AB1: call_scm_func @isAnyKeyPressed 0
 then
   // your code here...
 end
end

:isAnyKeyPressed
{
 Parameters:
   Passed:
     none
   Result:
     none

 Example:
   0AB1: call_scm_func @isAnyKeyPressed 0
}
for 0@ = 0x1 to 0xFE // 1 to 254
 if
 0AB0:  key_pressed 0@
 then
   0485: return_true
   0AB2: ret 0
 end
end
059A: return_false
0AB2: ret 0

Actually, there's still no way to prevent many thread iterations. sad.gif

Silent
  • Silent

    Moderating Cookie Monster

  • Members
  • Joined: 01 Feb 2010
  • Poland

#1103

Posted 22 September 2010 - 01:21 PM

I think that cheat pool can be used for that also.

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#1104

Posted 22 September 2010 - 02:01 PM

Unfortunately, 0x969110 gives only numbers, letters and space. whatsthat.gif

-ATP-
  • -ATP-

    GTA United Leading Developer

  • Members
  • Joined: 10 Oct 2009

#1105

Posted 03 October 2010 - 02:11 PM

Hey,
is it possible to get the current camera position (coordinates) from memory?

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#1106

Posted 03 October 2010 - 05:30 PM Edited by Wesser, 04 October 2010 - 07:33 PM.

Why don't you just use the opcode 068D?

CVehicle + 0x5A4 - [float] Train Speed (forward - 0.0 to 1.0, backwards - 0.0 to -1.0)

These values are picked according to the train track direction.

Donny78
  • Donny78

    Zombie

  • Members
  • Joined: 18 Jul 2008

#1107

Posted 13 October 2010 - 02:50 PM Edited by Donny78, 16 October 2010 - 03:34 PM.

Edit:

Ignore this, act natural, carry on... moto_whistle.gif

yair1221
  • yair1221

    Homie

  • Members
  • Joined: 18 Feb 2010

#1108

Posted 15 October 2010 - 01:53 PM Edited by yair1221, 15 October 2010 - 03:47 PM.

i dunno if anyone said those, found them all in ryosuke's air limit changer:

hydra rocket reload time, just use write memory, 4 bytes, miliseconds, use them both with same value:

CODE
0x6D462E
0x6D4634


hydra flares:

CODE
0x6E351B


hydra lock on delay:

CODE
0x6E363A
0x6E36FB


all are 4 bytes

-ATP-
  • -ATP-

    GTA United Leading Developer

  • Members
  • Joined: 10 Oct 2009

#1109

Posted 24 October 2010 - 05:35 PM

QUOTE (Wesser @ Oct 3 2010, 17:30)
Why don't you just use the opcode 068D?

Because my plan was to create an external programm, not a script. But anyway, I created a script for my requirement now.

Another question, is it possible to check out if a car has radio?

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#1110

Posted 24 October 2010 - 09:05 PM Edited by Wesser, 24 October 2010 - 09:30 PM.

Would you be more clear? Do you want to check if a vehicle can have radio stations changeable? I think, only law enforcement vehicles don't allow choosing radio stations, so use the opcode 0975.

Edit: Huge update of this post.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users