CLEO Help .cs help

CLEO related
Status
Not open for further replies.

AyoSway

Member
Joined
Feb 10, 2015
Messages
6
Reaction score
0
So I have a cleo which teleports to a checkpoint and immediately back to where you were in the first place.. It is activated by pressing key "Y". I would like to change that to a sampfuncs sided command. I am not experienced in coding at all and am wondering if somebody can edit this cleo for me? I have tried multiple different things but couldn't seem to figure it out on my own. Also because it doesn't let me re-compile the file even without editing it? Not sure.. Let me know if you can help 

Code:
{$CLEO}

thread "fak"

:ct
wait 0
if
    0AB0: 89
then    
if     
    call @is_cp_active 0
then
    call @get_cp_pos 0 1@ 2@ 3@
    if
        044B: $PLAYER_ACTOR
    then
        call @SendOnFootDataSync 3 1@ 2@ 3@
    else        
        call @SendInCarDataSync 3 1@ 2@ 3@
    end    
end
end
jump @ct
    

:is_cp_active
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AA3: freelib 0@
0AB2: ret 0

:get_cp_pos
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
0AB2: ret 3 2@ 3@ 4@

:SendOnFootDataSync
0B2B: 3@ = $PLAYER_ACTOR
0BBA: 3@ 4@
alloc 4@ 68
0C0D: 4@ 6 4 = 0@
0C0D: 4@ 10 4 = 1@
0C0D: 4@ 14 4 = 2@
0BC0: 4@
free 4@
ret 0 

:SendInCarDataSync                 
3@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR) 
3@ = SAMP.GetPlayerStruct(3@) 
3@ += 170
0AC8: 4@ = allocate_memory_size 63 
0C10: memcpy destination 4@ source 3@ size 63 
0C0D: struct 4@ offset 24 size 4 = 0@ 
0C0D: struct 4@ offset 28 size 4 = 1@ 
0C0D: struct 4@ offset 32 size 4 = 2@ 
0B3D: raknet 5@ = new_bit_stream 
RakNet.Write(5@, 200, BS_TYPE_BYTE, 1) 
RakNet.Write(5@, 4@, BS_TYPE_ARRAY, 63) 
0B8B: raknet send bit_stream 5@                 
0B3E: raknet delete_bit_stream 5@ 
0AC9: 4@ 
0AB2: ret 0
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
there you go meine freunde
Code:
{$CLEO}

thread "fak"

repeat                                                               //new
wait 50                                                              //new
until 0AFA:  is_samp_available                                       //new
0B34: samp register_client_command "fak" to_label @cmd_trigger       //new

:ct
wait 0

if 31@ == 1                                                          //new
then    
    30@ = 0                                                          //new
    
    if    
       call @is_cp_active 0
    then
       call @get_cp_pos 0 1@ 2@ 3@
       if
           044B: $PLAYER_ACTOR
       then
           call @SendOnFootDataSync 3 1@ 2@ 3@
       else        
           call @SendInCarDataSync 3 1@ 2@ 3@
       end    
    end
end

jump @ct

:cmd_trigger                                                         //new
31@ = 1                                                              //new
samp.CmdRet()                                                        //new
   

:is_cp_active
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AA3: freelib 0@
0AB2: ret 0

:get_cp_pos
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
0AB2: ret 3 2@ 3@ 4@

:SendOnFootDataSync
0B2B: 3@ = $PLAYER_ACTOR
0BBA: 3@ 4@
alloc 4@ 68
0C0D: 4@ 6 4 = 0@
0C0D: 4@ 10 4 = 1@
0C0D: 4@ 14 4 = 2@
0BC0: 4@
free 4@
ret 0

:SendInCarDataSync                
3@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR)
3@ = SAMP.GetPlayerStruct(3@)
3@ += 170
0AC8: 4@ = allocate_memory_size 63
0C10: memcpy destination 4@ source 3@ size 63
0C0D: struct 4@ offset 24 size 4 = 0@
0C0D: struct 4@ offset 28 size 4 = 1@
0C0D: struct 4@ offset 32 size 4 = 2@
0B3D: raknet 5@ = new_bit_stream
RakNet.Write(5@, 200, BS_TYPE_BYTE, 1)
RakNet.Write(5@, 4@, BS_TYPE_ARRAY, 63)
0B8B: raknet send bit_stream 5@                
0B3E: raknet delete_bit_stream 5@
0AC9: 4@
0AB2: ret 0

btw to compile codes with sampfuncs keywords and opcodes sanny builder plugin is required

http://ugbase.eu/Thread-ASI-SAMPFUNCS-5-3-0-3-7
   sf_5_X_X_sdk.zip : contains both the dev. files for CLEO and C++ API.
   - Copy all files from the "SB data" to "/Sanny Builder 3/data/sa".
 
Status
Not open for further replies.
Top