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

Doublesix

Active Member
Joined
Nov 14, 2018
Messages
44
Likes
0
Points
6
5
#1
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 [email protected] 260
alloc [email protected] 260
SAMP.GetChatString(99, [email protected], [email protected], [email protected], [email protected])
if
0C29: $NOT_USED = stristr string1 [email protected] string2 "[Mechanic Call] {33CCFF}%s {FFFFFF}called a mechanic at {33AA33}%s {FFFFFF}(/infomech %d)" [email protected] [email protected] [email protected]
else_jump @AutoAMCall_65
wait 1000
0AD3: [email protected] = format "/amcall %d" [email protected]
say [email protected]
wait 1000
goto @AutoAMCall_65
And this is the text for Mechanic Call.
 

Attachments

Opcode.eXe

Well-Known Member
Joined
Feb 18, 2013
Messages
1,393
Likes
108
Points
113
Location
( ͡° ͜ʖ ͡°)
Website
www.youtube.com
#2
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: [email protected] = allocate_memory_size 260   
    0B75: samp get_chat_string 99 text_to [email protected] prefix_to [email protected] color_to [email protected] prefix_color_to [email protected]
    IF
    0AD4: [email protected] = scan_string [email protected] format "[Mechanic Call] {33CCFF}%s" [email protected] // used: [email protected],[email protected],[email protected],[email protected]
    THEN
        0AF9: samp say_msg "/amcall %s" [email protected] // will type /amcall NAME
        wait 2500
    END
    0AC9: free_allocated_memory [email protected]
END
 

Opcode.eXe

Well-Known Member
Joined
Feb 18, 2013
Messages
1,393
Likes
108
Points
113
Location
( ͡° ͜ʖ ͡°)
Website
www.youtube.com
#3
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: [email protected] = allocate_memory_size 260   
    0B75: samp get_chat_string 99 text_to [email protected] prefix_to [email protected] color_to [email protected] prefix_color_to [email protected]
    IF
    0AD4: [email protected] = scan_string [email protected] format "[Mechanic Call] {33CCFF}%s" [email protected] // used: [email protected],[email protected],[email protected],[email protected]
    THEN
        
        0ab1: @get_playerid_by_name 1 [email protected] [email protected]
        0AF9: samp say_msg "/amcall %d" [email protected] // will type /amcall playerid
        wait 2500       
        
        
        
    END
    0AC9: free_allocated_memory [email protected]
END


:getPlayerIdByName
for [email protected] = 0 to 1000
    if SAMP.IsPlayerConnected([email protected])
    then
        [email protected] = SAMP.GetPlayerNickname([email protected])
        if 0C14: strcmp string1 [email protected] string2 [email protected]
        then break
        end
    end
end
0ab2: 1 [email protected]
 
OP
OP
Doublesix

Doublesix

Active Member
Joined
Nov 14, 2018
Messages
44
Likes
0
Points
6
5
#4
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: [email protected] = allocate_memory_size 260  
    0B75: samp get_chat_string 99 text_to [email protected] prefix_to [email protected] color_to [email protected] prefix_color_to [email protected]
    IF
    0AD4: [email protected] = scan_string [email protected] format "[Mechanic Call] {33CCFF}%s" [email protected] // used: [email protected],[email protected],[email protected],[email protected]
    THEN
        0AF9: samp say_msg "/amcall %s" [email protected] // will type /amcall NAME
        wait 2500
    END
    0AC9: free_allocated_memory [email protected]
END
Thanks man, it work.
 
OP
OP
Doublesix

Doublesix

Active Member
Joined
Nov 14, 2018
Messages
44
Likes
0
Points
6
5
#5
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: [email protected] = allocate_memory_size 260  
    0B75: samp get_chat_string 99 text_to [email protected] prefix_to [email protected] color_to [email protected] prefix_color_to [email protected]
    IF
    0AD4: [email protected] = scan_string [email protected] format "[Mechanic Call] {33CCFF}%s" [email protected] // used: [email protected],[email protected],[email protected],[email protected]
    THEN
       
        0ab1: @get_playerid_by_name 1 [email protected] [email protected]
        0AF9: samp say_msg "/amcall %d" [email protected] // will type /amcall playerid
        wait 2500      
       
       
       
    END
    0AC9: free_allocated_memory [email protected]
END


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

Doublesix

Active Member
Joined
Nov 14, 2018
Messages
44
Likes
0
Points
6
5
#11
/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

Well-Known Member
Joined
Feb 18, 2013
Messages
1,393
Likes
108
Points
113
Location
( ͡° ͜ʖ ͡°)
Website
www.youtube.com
#12
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

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


:getPlayerIdByName
for [email protected] = 0 to 1000
    if SAMP.IsPlayerConnected([email protected])
    then
        [email protected] = SAMP.GetPlayerNickname([email protected])
        if 0C29: [email protected] = stristr string1 [email protected] string2 [email protected]
        then break
        end
    end
end
0ab2: 1 [email protected]
 
OP
OP
Doublesix

Doublesix

Active Member
Joined
Nov 14, 2018
Messages
44
Likes
0
Points
6
5
#13
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

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


:getPlayerIdByName
for [email protected] = 0 to 1000
    if SAMP.IsPlayerConnected([email protected])
    then
        [email protected] = SAMP.GetPlayerNickname([email protected])
        if 0C29: [email protected] = stristr string1 [email protected] string2 [email protected]
        then break
        end
    end
end
0ab2: 1 [email protected]
Thanks, it work.
 
Top