Lancerator Posted May 2, 2018 Share Posted May 2, 2018 // 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 More sharing options...
Sloth- Posted May 2, 2018 Share Posted May 2, 2018 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 Lancerator 1 Link to comment Share on other sites More sharing options...
Diegoti Posted May 2, 2018 Share Posted May 2, 2018 Sorry but, what does that script? Link to comment Share on other sites More sharing options...
Lancerator Posted May 2, 2018 Author Share Posted May 2, 2018 (edited) 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 May 2, 2018 by SMACKED! Link to comment Share on other sites More sharing options...
Sloth- Posted May 2, 2018 Share Posted May 2, 2018 (edited) 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 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 May 2, 2018 by Sloth- Lancerator 1 Link to comment Share on other sites More sharing options...
Sloth- Posted May 2, 2018 Share Posted May 2, 2018 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 Lancerator 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now