Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      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

Help out with this little code.


Lancerator
 Share

Recommended Posts

Lancerator
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013{$CLEO .cs}//-------------MAIN---------------0000: NOP :NONAME_2wait 0 if    Player.Defined($PLAYER_CHAR)else_jump @NONAME_2 jump @NONAME_29 :NONAME_29wait 0 023C: load_special_actor 'SMOKEV' as 1 // models 290-299 if 023D:   special_actor 1 loaded else_jump @NONAME_29 jump @NONAME_68 :NONAME_68wait 0 if 0AB0:   key_pressed 8 else_jump @NONAME_125 09C7: change_player $PLAYER_CHAR model_to #SPECIAL01 Actor.PutAt($PLAYER_ACTOR, 2520.222, -1272.839, 34.885)Actor.Angle($PLAYER_ACTOR) = 88.4876:NONAME_125end_thread 

It compiles fine but whenever I press key 8 (which as far as I'm concerned is Backspace) the function doesn't ejecute. Any help?

Link to comment
Share on other sites

Try this.

 

 

 

 

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013{$CLEO .cs}//-------------MAIN---------------0000: NOP :NONAME_2wait 0 if    Player.Defined($PLAYER_CHAR)else_jump @NONAME_2 jump @NONAME_29 023C: load_special_actor 'SMOKEV' as 1 // models 290-299:NONAME_29wait 0 if 023D:   special_actor 1 loaded else_jump @NONAME_29 jump @NONAME_68 :NONAME_68wait 0 if 0AB0:   key_pressed 8 else_jump @NONAME_6809C7: change_player $PLAYER_CHAR model_to #SPECIAL01 Actor.PutAt($PLAYER_ACTOR, 2520.222, -1272.839, 34.885)Actor.Angle($PLAYER_ACTOR) = 88.4876:NONAME_125end_thread 

 

 

This is same code but more readable:

 

 

 

{$CLEO .cs}thread 'MyScript'repeatwait 0 until Player.Defined($PLAYER_CHAR)023C: load_special_actor 'SMOKEV' as 1 // models 290-299 repeatwait 0 until 023D:   special_actor 1 loaded repeatwait 0 until 0AB0:   key_pressed 8 09C7: change_player $PLAYER_CHAR model_to #SPECIAL01 Actor.PutAt($PLAYER_ACTOR, 2520.222, -1272.839, 34.885)Actor.Angle($PLAYER_ACTOR) = 88.4876end_thread

 

Link to comment
Share on other sites

Lancerator

This is same code but more readable:

 

 

{$CLEO .cs}thread 'MyScript'repeatwait 0 until Player.Defined($PLAYER_CHAR)023C: load_special_actor 'SMOKEV' as 1 // models 290-299 repeatwait 0 until 023D:   special_actor 1 loaded repeatwait 0 until 0AB0:   key_pressed 8 09C7: change_player $PLAYER_CHAR model_to #SPECIAL01 Actor.PutAt($PLAYER_ACTOR, 2520.222, -1272.839, 34.885)Actor.Angle($PLAYER_ACTOR) = 88.4876end_thread

 

 

This one made it work. May I do know what I did do wrong?

 

I have another problem.

I tried to change player's walkstyle form but it doesn't work.

I've also tried to change some acquaintances from some gangs and it seemed to work properly despite the walking thing.

 

Any help?

repeatwait 0 until 0AB0:   key_pressed 8 09C7: change_player $PLAYER_CHAR model_to #SPECIAL01 Actor.PutAt($PLAYER_ACTOR, 2520.222, -1272.839, 34.885)Actor.Angle($PLAYER_ACTOR) = 88.48760245: set_actor $PLAYER_CHAR walk_style_to "FATMAN"0746: set_acquaintance 1 of_actors_pedtype 7 to_actors_pedtype 00746: set_acquaintance 1 of_actors_pedtype 9 to_actors_pedtype 0end_thread
Edited by SMACKED!
Link to comment
Share on other sites

First: you are placing "023C: load_special_actor 'SMOKEV' as 1" inside a loop. Like if you are requesting the special actor load again and again, when you must do it only once.

:NONAME_29wait 0 023C: load_special_actor 'SMOKEV' as 1 // models 290-299 // <---- is inside a loopif 023D:   special_actor 1 loaded else_jump @NONAME_29 jump @NONAME_68 
023C: load_special_actor 'SMOKEV' as 1 // models 290-299 // <---- you first do the load request, then enter in the loop waiting the model to be loaded:NONAME_29wait 0 if 023D:   special_actor 1 loaded else_jump @NONAME_29 jump @NONAME_68 

But maybe this mistake would have not cause trouble by itself if the actor loading occurs fast enough.

 

Second, and this is the real cause of the bad functioning:

 

Read carefully this loop as it is:

:NONAME_68wait 0 if 0AB0:   key_pressed 8 else_jump @NONAME_125 09C7: change_player $PLAYER_CHAR model_to #SPECIAL01 Actor.PutAt($PLAYER_ACTOR, 2520.222, -1272.839, 34.885)Actor.Angle($PLAYER_ACTOR) = 88.4876:NONAME_125end_thread 

It says: "if you press key 8, do all the skin change, else jump @NONAME_125".

But NONAME_125 will take you to the end of the thread. So, when you run the script, you obligatorily are not pressing the key at the begining of the runtime. So, in consequence, you are ending the thread at the very beggining.

 

To fix that, just replace "else_jump @NONAME_125" by "else_jump @NONAME_68", and your script will do the loop.

 

And i almost forget it.

CLEO threads must end with this instruction:

0A93: end_custom_thread

Don't use this "end_thread", or you could experience crashes (actually, i'm surprised your game hasn't crashed with second script :lol: sorry about that).

 

 

 

Sorry but, what does that script?

 

It changes player skin to model named "SMOKEV" by pressing backspace.

(SMOKEV is one of the Big Smoke models).

http://wiki.sa-mp.com/wiki/Skins:All

Edited by Sloth-
Link to comment
Share on other sites

I have another problem.

I tried to change player's walkstyle form but it doesn't work.

I've also tried to change some acquaintances from some gangs and it seemed to work properly despite the walking thing.

 

Any help?

 

In order to change player walkstyles you must deal with advanced tricks:

// ... your code// This is for changing to another walkstylegosub @ReadFromPedsIde 0245: set_actor $PLAYER_ACTOR walk_style_to "FATMAN"// This is for restoring default walkstylegosub @ReadFromMemory// (...){============================================================================================================================================}:[email protected] = 0x609A4E return :ReadFromMemorygosub @GetBaseAddress 0A8C: write_memory [email protected] size 4 value 0x04D48689 virtual_protect 1 [email protected] += 0x4 0A8C: write_memory [email protected] size 2 value 0x0 virtual_protect 1 return :ReadFromPedsIdegosub @GetBaseAddress 0A8C: write_memory [email protected] size 4 value 0x90909090 virtual_protect 1 [email protected] += 0x4 0A8C: write_memory [email protected] size 2 value 0x9090 virtual_protect 1 return
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.