CLEO Help cant edit script

CLEO related
Status
Not open for further replies.

H0ven

Member
Joined
Feb 13, 2020
Messages
7
Reaction score
6
Location
Lithuania
hello i downloaded one script for my server, but i can't edit it, because when i compile it i get 1 error, if i fix it i get another one, any suggestions?

first error:


second error:
 

Attachments

  • 1642796662825.png
    1642796662825.png
    8.6 KB · Views: 22
  • 1642796678892.png
    1642796678892.png
    9 KB · Views: 19

Kross

Active member
Joined
Dec 15, 2021
Messages
149
Reaction score
42
edit
PHP:
{$CLEO}
0000:
thread "astap"

const
    VK_MULTIPLY =   0x6A // '*'
    VK_DIVIDE =     0x6F // '/'
    VK_SUBTRACT =   0x6D // '-'

    CPED_PTRPTR =   0xB74490   
    
    MAX_DIST =      10.0   
end

while not SAMP.Available
    wait 0
end

while true
    wait 0
    
    if key_down 0x6A :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/pagydyti %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
    
    if key_down 0x6F :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/gaivint %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end 
    
    if key_down 0x6D :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/sarvai %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
end

:getNearestPlayerNicknamePtr
8@ = 0
10@ = 0
28@ = 10.0
Actor.StorePos($PLAYER_ACTOR, 4@ 5@ 6@)

0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 1
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 1

for 30@ = 0 to 35584 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 1
    000A: 29@ += 0x1
    if and
        0029: 31@ >= 0x0
        001B: 0x80 > 31@
    then
        005A: 31@ += 30@
                
        if and
            056D:   actor 31@ defined
            803B:  31@ != $PLAYER_ACTOR
        then
            0B2B: samp 0@ = get_player_id_by_actor_handle 31@   
            0B36: samp 9@ = get_player_nickname 0@
            Actor.StorePos(31@ , 1@ 2@ 3@)                       
            050A: 7@ = distance_between_XYZ 1@ 2@ 3@ and_XYZ 4@ 5@ 6@
            
            if 0025:   7@ > 28@
            then continue               
            else
                0087: 28@ = 7@
                0085: 8@ = 31@
            end               
        end             
    end
end

if 0B2B: samp 9@ = get_player_id_by_actor_handle 8@
then
    0B36: samp 10@ = get_player_nickname 9@   
end
ret 1 10@
 

Attachments

  • smithMEDIK.cs
    20 KB · Views: 2

H0ven

Member
Joined
Feb 13, 2020
Messages
7
Reaction score
6
Location
Lithuania
Try editing and tell me if it worked
PHP:
{$CLEO}
0000:
thread "astap"

const
    VK_MULTIPLY =   0x6A // '*'
    VK_DIVIDE =     0x6F // '/'
    VK_SUBTRACT =   0x6D // '-'

    CPED_PTRPTR =   0xB74490  
   
    MAX_DIST =      10.0  
end

while not SAMP.Available
    wait 0
end

while true
    wait 0
   
    if key_down 0x6A :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/pagydyti %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
   
    if key_down 0x6F :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/gaivint %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
   
    if key_down 0x6D :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/sarvai %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
end

:getNearestPlayerNicknamePtr
8@ = 0
10@ = 0
28@ = MAX_DIST
Actor.StorePos($PLAYER_ACTOR, 4@ 5@ 6@)

0A8D: 29@ = read_memory CPED_PTRPTR size 4 virtual_protect 1
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 1

for 30@ = 0 to 35584 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 1
    000A: 29@ += 0x1
    if and
        0029: 31@ >= 0x0
        001B: 0x80 > 31@
    then
        005A: 31@ += 30@
               
        if and
            056D:   actor 31@ defined
            803B:  31@ != $PLAYER_ACTOR
        then
            0B2B: samp 0@ = get_player_id_by_actor_handle 31@  
            0B36: samp 9@ = get_player_nickname 0@
            Actor.StorePos(31@ , 1@ 2@ 3@)                      
            050A: 7@ = distance_between_XYZ 1@ 2@ 3@ and_XYZ 4@ 5@ 6@
           
            if 0025:   7@ > 28@
            then continue              
            else
                0087: 28@ = 7@
                0085: 8@ = 31@
            end              
        end            
    end
end

if 0B2B: samp 9@ = get_player_id_by_actor_handle 8@
then
    0B36: samp 10@ = get_player_nickname 9@  
end
ret 1 10@


now i get this error
 

Attachments

  • 1642798003230.png
    1642798003230.png
    8.8 KB · Views: 10

Kross

Active member
Joined
Dec 15, 2021
Messages
149
Reaction score
42
edit
PHP:
{$CLEO}
0000:
thread "astap"

const
    VK_MULTIPLY =   0x6A // '*'
    VK_DIVIDE =     0x6F // '/'
    VK_SUBTRACT =   0x6D // '-'

    CPED_PTRPTR =   0xB74490  
   
    MAX_DIST =      10.0  
end

while not SAMP.Available
    wait 0
end

while true
    wait 0
   
    if key_down 0x6A :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/pagydyti %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
   
    if key_down 0x6F :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/gaivint %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
   
    if key_down 0x6D :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/sarvai %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
end

:getNearestPlayerNicknamePtr
8@ = 0
10@ = 0
28@ = 10.0
Actor.StorePos($PLAYER_ACTOR, 4@ 5@ 6@)

0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 1
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 1

for 30@ = 0 to 35584 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 1
    000A: 29@ += 0x1
    if and
        0029: 31@ >= 0x0
        001B: 0x80 > 31@
    then
        005A: 31@ += 30@
               
        if and
            056D:   actor 31@ defined
            803B:  31@ != $PLAYER_ACTOR
        then
            0B2B: samp 0@ = get_player_id_by_actor_handle 31@  
            0B36: samp 9@ = get_player_nickname 0@
            Actor.StorePos(31@ , 1@ 2@ 3@)                      
            050A: 7@ = distance_between_XYZ 1@ 2@ 3@ and_XYZ 4@ 5@ 6@
           
            if 0025:   7@ > 28@
            then continue              
            else
                0087: 28@ = 7@
                0085: 8@ = 31@
            end              
        end            
    end
end

if 0B2B: samp 9@ = get_player_id_by_actor_handle 8@
then
    0B36: samp 10@ = get_player_nickname 9@  
end
ret 1 10@
I have edited the script and updated the attachment
 

Kross

Active member
Joined
Dec 15, 2021
Messages
149
Reaction score
42
here
PHP:
{$CLEO}
0000:
thread "astap"

const
    VK_MULTIPLY =   0x6A // '*'
    VK_DIVIDE =     0x6F // '/'
    VK_SUBTRACT =   0x6D // '-'

    CPED_PTRPTR =   0xB74490   
    
    MAX_DIST =      10.0   
end

while not SAMP.Available
    wait 0
end

while true
    wait 0
    
    if key_down 0x6A :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/pagydyti %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
    
    if key_down 0x6F :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/gaivinti %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end 
    
    if key_down 0x6D :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/sarvai %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
end

:getNearestPlayerNicknamePtr
8@ = 0
10@ = 0
28@ = 10.0
Actor.StorePos($PLAYER_ACTOR, 4@ 5@ 6@)

0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 1
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 1

for 30@ = 0 to 35584 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 1
    000A: 29@ += 0x1
    if and
        0029: 31@ >= 0x0
        001B: 0x80 > 31@
    then
        005A: 31@ += 30@
                
        if and
            056D:   actor 31@ defined
            803B:  31@ != $PLAYER_ACTOR
        then
            0B2B: samp 0@ = get_player_id_by_actor_handle 31@   
            0B36: samp 9@ = get_player_nickname 0@
            Actor.StorePos(31@ , 1@ 2@ 3@)                       
            050A: 7@ = distance_between_XYZ 1@ 2@ 3@ and_XYZ 4@ 5@ 6@
            
            if 0025:   7@ > 28@
            then continue               
            else
                0087: 28@ = 7@
                0085: 8@ = 31@
            end               
        end             
    end
end

if 0B2B: samp 9@ = get_player_id_by_actor_handle 8@
then
    0B36: samp 10@ = get_player_nickname 9@   
end
ret 1 10@
 

Attachments

  • smithMEDIK.cs
    20 KB · Views: 1

H0ven

Member
Joined
Feb 13, 2020
Messages
7
Reaction score
6
Location
Lithuania
here
PHP:
{$CLEO}
0000:
thread "astap"

const
    VK_MULTIPLY =   0x6A // '*'
    VK_DIVIDE =     0x6F // '/'
    VK_SUBTRACT =   0x6D // '-'

    CPED_PTRPTR =   0xB74490  
   
    MAX_DIST =      10.0  
end

while not SAMP.Available
    wait 0
end

while true
    wait 0
   
    if key_down 0x6A :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/pagydyti %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
   
    if key_down 0x6F :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/gaivinti %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
   
    if key_down 0x6D :
    then
        if call @getNearestPlayerNicknamePtr 0 0@
        then
            alloc 1@ 128
            format 1@ = "/sarvai %s" 0@
            say 1@
            free 1@
            wait 1000
        end
    end
end

:getNearestPlayerNicknamePtr
8@ = 0
10@ = 0
28@ = 10.0
Actor.StorePos($PLAYER_ACTOR, 4@ 5@ 6@)

0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 1
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 1

for 30@ = 0 to 35584 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 1
    000A: 29@ += 0x1
    if and
        0029: 31@ >= 0x0
        001B: 0x80 > 31@
    then
        005A: 31@ += 30@
               
        if and
            056D:   actor 31@ defined
            803B:  31@ != $PLAYER_ACTOR
        then
            0B2B: samp 0@ = get_player_id_by_actor_handle 31@  
            0B36: samp 9@ = get_player_nickname 0@
            Actor.StorePos(31@ , 1@ 2@ 3@)                      
            050A: 7@ = distance_between_XYZ 1@ 2@ 3@ and_XYZ 4@ 5@ 6@
           
            if 0025:   7@ > 28@
            then continue              
            else
                0087: 28@ = 7@
                0085: 8@ = 31@
            end              
        end            
    end
end

if 0B2B: samp 9@ = get_player_id_by_actor_handle 8@
then
    0B36: samp 10@ = get_player_nickname 9@  
end
ret 1 10@

thank you everything works fine now
 
Status
Not open for further replies.
Top