Resource icon

CLEO Release Automatic Skin Changer

CLEO related
Status
Not open for further replies.

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Current Version: 1.0.0

Information:
  1. This Script Allows you to change to any skin your want.
  2. The Best Feature of this CLEO Script is that it automatically changes our player skin into the selected skin every time our player skin resets due to:
    • Player Death
    • Server Forced you to Change Skin
  3. Type /myskin <Skin ID> to Set your Player Skin
  4. Type /myskin to Enable/Disable the Automatic Changing of Skin.

Source Code:
Code:
{
    NOTICE:
        This Code was an Improved Version and Successor of the OLD but GOLD /fskin changer
    Credits:
        - /fskin Changer's Author
        - AJOM - This Code Version's Author
        - Parazitas - SAMP Memory Offsets, Any SAMP Version Compatibility
}
{$CLEO}
03A4: script_name 'ASkinC'

const
    ISENABLED = 31@
    ACTORMODEL = 30@
end

wait 10000
   
while true
    wait 0
    if 0AB1: @GetLastSentTextFromChatBox 0 _Return_Text 0@
    then
        0AC6: 1@ = label @chatcommand pointer
        if 0AB1: @strincmp 3 _String1 0@ _String2 1@ _Size 7
        then
            0A8E: 2@ = 0@ + 7 // space plus parameter offset
            if 0AD4: 3@ = scan_string 2@ format " %d" 1@ // read command and digit to format
            then
                if and
                    1@ >= 0
                    1@ <= 311
                then
                        // release the old model to free memory
                    if and
                        ACTORMODEL >= 0
                        ACTORMODEL <= 311
                    then
                        if 0248: model ACTORMODEL available
                        then 0249: release_model ACTORMODEL
                        end
                    end
                        //
                    0085: ACTORMODEL = 1@
                    ISENABLED = true // automatically enable "Automatic Skin Changer" to avoid skin reset
                end
            else
                if ISENABLED == true
                then
                    ISENABLED = false
                    0AD1: "~Y~AJOM's Automatic Skin Changer v1.0.0: ~N~  ~R~Disabled" 1337
                else
                    ISENABLED = true
                    0AD1: "~Y~AJOM's Automatic Skin Changer v1.0.0: ~N~ ~G~Enabled" 1337
                end
            end
            0A8C: writeMem 0@ sz 1 vl 0 vp 0 // clear last entered text from chatbox
        end
    end
   
    if and
        ISENABLED == true
        ACTORMODEL >= 0
        ACTORMODEL <= 311
        0256: player $PLAYER_CHAR defined
    then
        if 82F2: not actor $PLAYER_ACTOR model == ACTORMODEL
        then
                // load the model first!
            while 8248: not model ACTORMODEL available
                0247: load_model ACTORMODEL
                wait 0
            end
                //
            if 82F2: not actor $PLAYER_ACTOR model == ACTORMODEL
            then // change our skin model
                09C7: change_player $PLAYER_CHAR model_to ACTORMODEL
                01B4: set_player $PLAYER_CHAR can_move true
            end
        end
    end
end

:GetLastSentTextFromChatBox // if 0AB1: @GetLastSentTextFromChatBox 0 _Return_Text 1@
    // All of these SAMP Memory Offsets were given by Parazitas
    IF 0AA2: 31@ = "samp.dll"
    THEN
        0A8E: 30@ = 31@ + 0x128
        0A8D: 29@ = readMem 30@ sz 4 vp 1 // Get SAMP Version ID
        IF 29@ == 0x5542F47A
        THEN // 0.3.7 R1
            0A8E: 30@ = 31@ + 0x21A0E8 // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            // 0A8E: 27@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        ELSE IF 29@ == 0x59C30C94
        THEN // 0.3.7 R2
            0A8E: 30@ = 31@ + 0x21A0F0 // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            // 0A8E: 27@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        ELSE IF 29@ == 0x5A6A3130
        THEN // 0.3.DL
            0A8E: 30@ = 31@ + 0x2ACA14 // CHAT_INPUTBOX_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            // 0A8E: 27@ = 30@ + 0x14E5 // COMMAND_OFFSET
            0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
        ELSE
            30@ -= 8 // reading Version ID at samp.dll + 0x120
            0A8D: 29@ = readMem 30@ sz 4 vp 1
            IF 29@ == 0x5C0B4243
            THEN // 0.3.7 R3
                0A8E: 30@ = 31@ + 0x26E8CC // CHAT_INPUTBOX_OFFSET
                0A8D: 30@ = readMem 30@ sz 4 vp 0
                // 0A8E: 27@ = 30@ + 0x14E5 // COMMAND_OFFSET
                0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
            ELSE IF 29@ == 0x5DD606CD
            THEN // 0.3.7 R4
                0A8E: 30@ = 31@ + 0x26E9FC // CHAT_INPUTBOX_OFFSET
                0A8D: 30@ = readMem 30@ sz 4 vp 0
                // 0A8E: 27@ = 30@ + 0x14E5 // COMMAND_OFFSET
                0A8E: 28@ = 30@ + 0x1565 // TEXT_OFFSET
            END
            END
        END
        END
        END
    END
    if 28@ > 0
    then 0485:  return_true
    else 059A:  return_false
    end
    // 0AB2: ret 2 27@ 28@
0AB2: ret 1 28@

:strincmp // if 0AB1: @strincmp 3 _String1 0@ _String2 1@ _Size 2@ // sized case insensitived string comparing
    // by AJOM
    for 31@ = 1 to 2@
        0A8D: 30@ = read_memory 0@ size 1 virtual_protect 0
        0A8D: 29@ = read_memory 1@ size 1 virtual_protect 0
            // make both characters to lowercase
        if and
            30@ >= 65 // A
            30@ <= 90 // Z
            29@ >= 97 // a
            29@ <= 122 // z
        then 30@ += 32 // convert char 30@ to lowercase
        else
            if and
                29@ >= 65 // A
                29@ <= 90 // Z
                30@ >= 97 // a
                30@ <= 122 // z
            then 29@ += 32 // convert char 29@ to lowercase
            else
            end
        end
            //
        if 803B: not 30@ == 29@
        then
            059A:  return_false
            ret 0
        else
            0@++
            1@++
        end
    end
0485:  return_true
ret 0

:chatcommand
hex
    "/myskin"
end

NOTICE:
  • This Code was an Improved Version and Successor of the OLD but GOLD /fskin changer
  • This Script is SAMP Universally Compatible. Meaning this script will work on any SAMP Version.
Credits:
  • /fskin Changer's Author
  • AJOM - This CLEO Code Version's Author
  • Parazitas - SAMP Memory Offsets, Any SAMP Version Compatibility
 

Attachments

  • Automatic Skin Changer.cs
    6.9 KB · Views: 138
Last edited:

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Can other people see the skin or is it only client based?
Unsynced/Client Based. But if anyone have an idea how to sync skin, feel free to post a turorial and I will update the script.
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
@ajom why is it crpyted bro

Use the Cleo Source Code Above if you want to recycle/edit the cleo script. Both the Compiled Script and the Source Code above is exactly the same, so there is no need to decompile the script.

I use my own Custom made Compiler for cleo scripts, it just happens that Sanny Builder's decompiling Algorithm can't extract it properly.
 
Status
Not open for further replies.
Top