Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Contract
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[SA] I have several questions.


MKKJ
 Share

Recommended Posts

(zooms camera)

While cleo scripting there are some things i've been wondered about. I want to ask since i either can't figure it out or prefer someone else confirm it.

 

1. What happen if actors/cars/spheres/markers/pickups left unreleased, and what happen to their variables?

As far as i know it would stuff up memory, and if i overwrite their variable it's just difficult to destroy them since you no longer have the pointer.

 

2. How can i read player's weapon poor/gangster/skill?

But not with comparing values from weapon.dat since it can be easily edited.

 

3. Related with previous question, how can i get player's weapon id from this list?

Some things might be easier if i could get those ids instead.

Edited by MKKJ
Link to comment
Share on other sites

1. I doubt they'll cause lags and crashes but yeah, you could run out of space in pools if you left them unreleased.

 

2. Not sure if it works on CJ - it should though.

 

0A96: [email protected] = actor $PLAYER_ACTOR [email protected] += 0x72C0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
If I recall correctly, 0 is Poor, 1 is Gangster, 2 is Hitman.

 

3. GET_CURRENT_CHAR_WEAPON

Link to comment
Share on other sites

2. Not working? It crashes my game...

 

3. How about poor and hitman animations? This opcode ignores them and only returns 'default' ids (0 - 46). I know some 'things' distinguish actor's weapon skill via id list above.

Link to comment
Share on other sites

For 2. you need CLEO - not going to work without it. And yes, 3 only returns those IDs - you use the skill parameter from 2. to distinguish instead.

Link to comment
Share on other sites

If you are familiar with CLEO function calls, you can save all the time writing your own routine by making good use of this information:

 

enum eWeaponSkill{	WEAPONSKILL_POOR,	WEAPONSKILL_STD,	WEAPONSKILL_PRO,	WEAPONSKILL_COP};0x005E3B60 - eWeaponSkill __thiscall CPed::GetWeaponSkill(eWeaponType weaponType)0x005E6580 - eWeaponSkill __thiscall CPed::GetWeaponSkill(void)0x00743C60 - CWeaponInfo *__cdecl CWeaponInfo::GetWeaponInfo(eWeaponType weaponType, eWeaponSkill weaponSkill)0x00743CD0 - int __cdecl CWeapon::GetSkillStatIndex(eWeaponType weaponType)
Retrieving the statistics index of a particular weapon is only useful to show how much you still have to get practice for the next level up. The game handles it internally to obtain the right weapon skill for players, whereas it just reads a CPed's member (+0x072C) for pedestrians which is always 3 for cops (or better yet anyone with COP pedtype set). Edited by Wesser

012          345
678   9A   BCD
EFG HIJK LMN

OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Awesome, Wesser. Though i totally have no slightest idea about functions, fortunately i found an example of how you did it from old post.

0A96: [email protected] = actor $PLAYER_ACTOR struct0470: [email protected] = actor $PLAYER_ACTOR current_weapon0AA8: call_function_method 0x5E6580 struct [email protected] num_params 0 pop 0 cSkillIndex [email protected]: call_function 0x743C60 num_params 2 pop 2 cSkillIndex 1[email protected] sWeaponType [email protected] pclWeaponInfo [email protected]

I assume this address i found ([email protected]) is start of weapon entry from weapon.dat, yes? And it seems each entry is sorted the same way like ids list i wrote in first post. So it's easy to get these ids from here.

 

Coincidentally, my actual intention is actually trying to obtain weapon damage from weapon.dat as well, which is like the way you did in the old post.

0A8E: [email protected] = [email protected] + 0x22 // Weapon Damage0A8D: [email protected] = read_memory [email protected] size 2 virtual_protect 1

So i pretty much found (more than) what i need. Much thanks, Wesser and Silent. Have some cookies :cookie::cookie::cookie::cookie:

Edited by MKKJ
Link to comment
Share on other sites

  • 3 months later...
  • 8 months later...

1. I doubt they'll cause lags and crashes but yeah, you could run out of space in pools if you left them unreleased.

 

2. Not sure if it works on CJ - it should though.

0A96: [email protected] = actor $PLAYER_ACTOR [email protected] += 0x72C0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
If I recall correctly, 0 is Poor, 1 is Gangster, 2 is Hitman.

 

3. GET_CURRENT_CHAR_WEAPON

 

 

Could you tell me what memory address corresponds to the GTA3script weapon_accuracy information: SET_WEAPON_ACCURACY or the function that does not exist ... GET_WEAPON_ACCURACY) of the ped (not weapon_skill [0,1,2]).
Based on this page ...
Corresponds to the same address you previously reported, but when trying to retrieve this value, I can only get the value 2 (int), regardless of the ped skill (already previously defined)
Thanks!
Link to comment
Share on other sites

 

0A96: [email protected] = actor [email protected] [email protected] += 0x71A0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0


case COMMAND_SET_CHAR_ACCURACY:  CRunningScript::CollectParameters((CRunningScript *)this, 2);  *(_BYTE *)(CPool<CPed>::atHandle((int)CPools::ms_pPedPool, *(_DWORD *)&ScriptParams)           + offsetof(CPed, m_nWeaponAccuracy)) = *((_BYTE *)&ScriptParams + 4);  return 0;

results of CPed.m_nWeaponAccuracy:

0x5E83EB    mov     [esi+71Ah], 3Ch             ; CPed::CPed0x5D2E10    mov     byte ptr [eax+71Ah], 64h    ; CPlayerPed::CPlayerPed0x60D822    mov     byte ptr [ecx+71Ah], 64h    ; CPlayerPed::SetupPlayerPed                          0x685A46    add     cl, 64h0x685A49    mov     [esi+71Ah], cl              ; CTaskSimplePlayerOnFoot::ProcessPlayerWeapon

0x5DDCE6    mov     byte ptr [esi+71Ah], 3Ch  ; CCopPed::CCopPed0x5DDDC3    mov     byte ptr [esi+71Ah], 44h  ; CCopPed::CCopPed0x5DDE03    mov     byte ptr [esi+71Ah], 4Ch  ; CCopPed::CCopPed0x5DDE43    mov     byte ptr [esi+71Ah], 54h  ; CCopPed::CCopPed
Last 4 discovered by DexX back in 2006 (page 16). Also documented in the database.
I don't know about the rest of them.
Link to comment
Share on other sites

0A96: [email protected] = actor [email protected] [email protected] += 0x71A0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0

 

 

case COMMAND_SET_CHAR_ACCURACY:  CRunningScript::CollectParameters((CRunningScript *)this, 2);  *(_BYTE *)(CPool<CPed>::atHandle((int)CPools::ms_pPedPool, *(_DWORD *)&ScriptParams)           + offsetof(CPed, m_nWeaponAccuracy)) = *((_BYTE *)&ScriptParams + 4);  return 0;

results of CPed.m_nWeaponAccuracy:

 

 

0x5E83EB    mov     [esi+71Ah], 3Ch             ; CPed::CPed0x5D2E10    mov     byte ptr [eax+71Ah], 64h    ; CPlayerPed::CPlayerPed0x60D822    mov     byte ptr [ecx+71Ah], 64h    ; CPlayerPed::SetupPlayerPed                          0x685A46    add     cl, 64h0x685A49    mov     [esi+71Ah], cl              ; CTaskSimplePlayerOnFoot::ProcessPlayerWeapon
0x5DDCE6    mov     byte ptr [esi+71Ah], 3Ch  ; CCopPed::CCopPed0x5DDDC3    mov     byte ptr [esi+71Ah], 44h  ; CCopPed::CCopPed0x5DDE03    mov     byte ptr [esi+71Ah], 4Ch  ; CCopPed::CCopPed0x5DDE43    mov     byte ptr [esi+71Ah], 54h  ; CCopPed::CCopPed
Last 4 discovered by DexX back in 2006 (page 16). Also documented in the database.

I don't know about the rest of them.

 

 

Thank you very much Jack, that's exactly what I need, just this simple address (0x71A) that I could not find in any post or website. I tested it here and it's functional! Again, thank you very much. See you... :colgate::^:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.