Help Cleo teleport to checkpoint

Xolokos

Active Member
Joined
May 2, 2014
Messages
28
Likes
0
Points
1
1
#1
PHP:
{$CLEO}

thread "CHECKPOINTSYNC"

:init
wait 0
[email protected] = 1

:ct
wait 0
if
    0AB0: 89
then    
if     
    call @is_cp_active 0
then
    call @get_cp_pos 0 [email protected] [email protected] [email protected]
    if
        044B: $PLAYER_ACTOR
    then
        call @SendOnFootDataSync 3 [email protected] [email protected] [email protected]
    else        
        call @SendInCarDataSync 3 [email protected] [email protected] [email protected]
    end    
end
end
jump @ct
    

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

:get_cp_pos
0AA2: [email protected] = loadlib "samp.dll"
0A8E: [email protected] = [email protected] + 0x21A10C
0A8D: [email protected] = readMem [email protected] sz 4 vp 0
[email protected] += 0xC
0A8D: [email protected] = readMem [email protected] sz 4 vp 0
[email protected] += 0x4
0A8D: [email protected] = readMem [email protected] sz 4 vp 0
[email protected] += 0x4
0A8D: [email protected] = readMem [email protected] sz 4 vp 0
0AA3: freelib [email protected]
0AB2: ret 3 [email protected] [email protected] [email protected]

:SendOnFootDataSync
0B2B: [email protected] = $PLAYER_ACTOR
0BBA: [email protected] [email protected]
alloc [email protected] 68
0C0D: [email protected] 6 4 = [email protected]
0C0D: [email protected] 10 4 = [email protected]
0C0D: [email protected] 14 4 = [email protected]
0BC0: [email protected]
free [email protected]
ret 0 

:SendInCarDataSync                 
[email protected] = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR) 
[email protected] = SAMP.GetPlayerStruct([email protected]) 
[email protected] += 170
0006: [email protected] += 1
//0AD1: show_formatted_text_highpriority "Y = %i" time 1000 $10
if [email protected] >= 8 
    then // (int)
    0AF9: samp say_msg "/recoltedrogues"
    0AD1: show_formatted_text_highpriority "Message envoyé !" time 1000  
    [email protected] = 0
end
0AC8: [email protected] = allocate_memory_size 63 
0C10: memcpy destination [email protected] source [email protected] size 63 
0C0D: struct [email protected] offset 24 size 4 = [email protected] 
0C0D: struct [email protected] offset 28 size 4 = [email protected] 
0C0D: struct [email protected] offset 32 size 4 = [email protected] 
0B3D: raknet [email protected] = new_bit_stream 
RakNet.Write([email protected], 200, BS_TYPE_BYTE, 1) 
RakNet.Write([email protected], [email protected], BS_TYPE_ARRAY, 63) 
0B8B: raknet send bit_stream [email protected]                 
0B3E: raknet delete_bit_stream [email protected] 
0AC9: [email protected] 
0AB2: ret 0
I tried to modify a code to send a samp cmd every 9 checkpoints but it doesn't works ?
 

Opcode.eXe

Well-Known Member
Joined
Feb 18, 2013
Messages
1,280
Likes
30
Points
98
Location
( ͡° ͜ʖ ͡°)
Website
www.youtube.com
10
#2
It's not working because:
Your counter variable is [email protected] and its value is set in the main thread.
You call the function SenDIncarData where you have [email protected] += 1, but when you call an function the variables will be reset in that function.
So what you can do is pass the variable [email protected] to the :sendincardata function.



But nah do it like this:


Code:
{$CLEO}

thread "CHECKPOINTSYNC"

:init
wait 0
[email protected] = 0

:ct
wait 0
if
    0AB0: 89
then    
if     
    call @is_cp_active 0
then
    call @get_cp_pos 0 [email protected] [email protected] [email protected]
    if
        044B: $PLAYER_ACTOR
    then
        call @SendOnFootDataSync 3 [email protected] [email protected] [email protected]
    else        
        call @SendInCarDataSync 3 [email protected] [email protected] [email protected]
    end    
    if [email protected] >= 8 
    then
        0AF9: samp say_msg "/recoltedrogues"
        0AD1: show_formatted_text_highpriority "Message envoyé !" time 1000  
        [email protected] = 0
    end
    [email protected] += 1
end
end
jump @ct
 
OP
OP
X

Xolokos

Active Member
Joined
May 2, 2014
Messages
28
Likes
0
Points
1
1
#3
I see now, but I've tried with a global value and it didn't worked either thanks for your help !
 
Top