CLEO Help Read Player ID's and Auto Accept Mechanic Call. Need help, please.

CLEO related
Status
Not open for further replies.

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
I want to make cleo for auto /amcall (Accept Mechanic Call).

This is the code. Idk why, it doesn't work at the Game (Nothing happen). Maybe someone can help me, please?

Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
thread "AutoAMCall"
0000: NOP

:AutoAMCall_52
wait 0
   SAMP.Available
else_jump @AutoAMCall_52

:AutoAMCall_65
wait 0
if and
   SAMP.IsLocalPlayerSpawned
   Actor.DrivingVehicleType($PLAYER_ACTOR, #TOWTRUCK)
else_jump @AutoAMCall_65
alloc 0@ 260
alloc 1@ 260
SAMP.GetChatString(99, 0@, 1@, 2@, 3@)
if
0C29: $NOT_USED = stristr string1 0@ string2 "[Mechanic Call] {33CCFF}%s {FFFFFF}called a mechanic at {33AA33}%s {FFFFFF}(/infomech %d)" 4@v 5@v 6@
else_jump @AutoAMCall_65
wait 1000
0AD3: 7@ = format "/amcall %d" 6@
say 7@
wait 1000
goto @AutoAMCall_65

And this is the text for Mechanic Call.
 

Attachments

  • Screenshot_265.png
    Screenshot_265.png
    17.5 KB · Views: 16

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
Soo.. is /infomech ID using the player id? If yes, this should work:

Code:
{$CLEO .cs}
0000:

REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
    WAIT 0
    0AC8: 0@ = allocate_memory_size 260   
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 33@ color_to 33@ prefix_color_to 33@
    IF
    0AD4: 33@ = scan_string 0@ format "[Mechanic Call] {33CCFF}%s" 1@v // used: 1@,2@,3@,4@
    THEN
        0AF9: samp say_msg "/amcall %s" 1@v // will type /amcall NAME
        wait 2500
    END
    0AC9: free_allocated_memory 0@
END
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
If it needs the player Id then you can use this:
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
    WAIT 0
    0AC8: 0@ = allocate_memory_size 260   
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 33@ color_to 33@ prefix_color_to 33@
    IF
    0AD4: 33@ = scan_string 0@ format "[Mechanic Call] {33CCFF}%s" 1@v // used: 1@,2@,3@,4@
    THEN
        
        0ab1: @get_playerid_by_name 1 1@v 10@
        0AF9: samp say_msg "/amcall %d" 10@ // will type /amcall playerid
        wait 2500       
        
        
        
    END
    0AC9: free_allocated_memory 0@
END


:getPlayerIdByName
for 1@ = 0 to 1000
    if SAMP.IsPlayerConnected(1@)
    then
        2@ = SAMP.GetPlayerNickname(1@)
        if 0C14: strcmp string1 0@ string2 2@
        then break
        end
    end
end
0ab2: 1 1@
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
Soo.. is /infomech ID using the player id? If yes, this should work:

Code:
{$CLEO .cs}
0000:

REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
    WAIT 0
    0AC8: 0@ = allocate_memory_size 260  
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 33@ color_to 33@ prefix_color_to 33@
    IF
    0AD4: 33@ = scan_string 0@ format "[Mechanic Call] {33CCFF}%s" 1@v // used: 1@,2@,3@,4@
    THEN
        0AF9: samp say_msg "/amcall %s" 1@v // will type /amcall NAME
        wait 2500
    END
    0AC9: free_allocated_memory 0@
END
Thanks man, it work.
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
If it needs the player Id then you can use this:
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
    WAIT 0
    0AC8: 0@ = allocate_memory_size 260  
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 33@ color_to 33@ prefix_color_to 33@
    IF
    0AD4: 33@ = scan_string 0@ format "[Mechanic Call] {33CCFF}%s" 1@v // used: 1@,2@,3@,4@
    THEN
       
        0ab1: @get_playerid_by_name 1 1@v 10@
        0AF9: samp say_msg "/amcall %d" 10@ // will type /amcall playerid
        wait 2500      
       
       
       
    END
    0AC9: free_allocated_memory 0@
END


:getPlayerIdByName
for 1@ = 0 to 1000
    if SAMP.IsPlayerConnected(1@)
    then
        2@ = SAMP.GetPlayerNickname(1@)
        if 0C14: strcmp string1 0@ string2 2@
        then break
        end
    end
end
0ab2: 1 1@
Not working. Invalid ID when i try at the Game.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
maybe it fails when the name has more than 16 characters because of 1@v being used, but idk
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
Yes but why do you use the 2nd one when the first one works?
For /infomech the player ID. It need the player ID.

This, sorry right now i'm using android for reply the thread.
 

Attachments

  • 1546446826619-1264932295.jpg
    1546446826619-1264932295.jpg
    913.6 KB · Views: 15

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
/amcall and /infomech is different, /amcall for accept the mechanic call and /infomech for check the caller mechanic information, its still available or not.
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
    WAIT 0
    0AC8: 0@ = allocate_memory_size 260   
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 33@ color_to 33@ prefix_color_to 33@
    IF
    0AD4: 33@ = scan_string 0@ format "[Mechanic Call] {33CCFF}%s" 1@v // used: 1@,2@,3@,4@
    THEN
        
        0ab1: @get_playerid_by_name 1 1@v 10@
        0AF9: samp say_msg "/infomech %d" 10@ // will type /amcall playerid
        wait 2500       
        
        
        
    END
    0AC9: free_allocated_memory 0@
END


:getPlayerIdByName
for 1@ = 0 to 1000
    if SAMP.IsPlayerConnected(1@)
    then
        2@ = SAMP.GetPlayerNickname(1@)
        if 0C29: 33@ = stristr string1 0@ string2 2@
        then break
        end
    end
end
0ab2: 1 1@
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
    WAIT 0
    0AC8: 0@ = allocate_memory_size 260  
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 33@ color_to 33@ prefix_color_to 33@
    IF
    0AD4: 33@ = scan_string 0@ format "[Mechanic Call] {33CCFF}%s" 1@v // used: 1@,2@,3@,4@
    THEN
       
        0ab1: @get_playerid_by_name 1 1@v 10@
        0AF9: samp say_msg "/infomech %d" 10@ // will type /amcall playerid
        wait 2500      
       
       
       
    END
    0AC9: free_allocated_memory 0@
END


:getPlayerIdByName
for 1@ = 0 to 1000
    if SAMP.IsPlayerConnected(1@)
    then
        2@ = SAMP.GetPlayerNickname(1@)
        if 0C29: 33@ = stristr string1 0@ string2 2@
        then break
        end
    end
end
0ab2: 1 1@
Thanks, it work.
 
Status
Not open for further replies.
Top