CLEO Help help me to found the mistake in this .cs

CLEO related
Status
Not open for further replies.

ramez

Active member
Joined
Jun 11, 2015
Messages
120
Reaction score
0
Location
GB
{$CLEO .cs}
0000:

REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

0B34: "did" @CMD

WHILE TRUE
WAIT 0
     IF
       0@ == 1
     THEN
         IF
           056D:   actor $PLAYER_ACTOR defined
         THEN
             0B4E: samp 1@ = get_current_dialog_id
             0AD4: 2@ = scan_string 1@ format "%d" 3@
             0AF8: samp add_message_to_chat "Dialog id; %d"  color -1 params 3@
         END
   END
END

             
:CMD
WAIT 0
0@ = 1
0ACF: show_formatted_styled_text "SCRIPT ACTIVATED" time 2000 style 2 0x0ACF
SAMP.CmdRet  
4HkEo2Q.png
 

bladero

Active member
Joined
Jan 3, 2017
Messages
73
Reaction score
0
Can you say whats not working ?
EDIT: Make sure you have set case converting to as is and make sure that you succesfully get dialog id. (dont know why u need to print dialog id..)
 

noob213

Active member
Joined
Sep 15, 2017
Messages
88
Reaction score
6
Code:
{$CLEO}
0000:

REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

0B34: "didon" @ON
0B34: "didoff" @OFF

WHILE TRUE
WAIT 0
     IF
       0@ == 1
     THEN
         IF
           056D:   actor $PLAYER_ACTOR defined
         THEN
             0B4E: samp 1@ = get_current_dialog_id
             chatmsg "{00FF7F}Dialog ID: %d" -1 1@
         END
   END
END

             
:ON
0@ = 1
print "SCRIPT ACTIVATED" 2000
0B43: samp cmd_ret

:OFF
0@ = 0
print "SCRIPT DESACTIVATED" 2000
0B43: samp cmd_ret
 

ramez

Active member
Joined
Jun 11, 2015
Messages
120
Reaction score
0
Location
GB
supahdupahnubah said:
0B4E: samp 1@ = get_current_dialog_id
            0AF8: samp add_message_to_chat "Dialog id; %d"  color -1 params 1@

crash


noob213 said:
Code:
{$CLEO}
0000:

REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

0B34: "didon" @ON
0B34: "didoff" @OFF

WHILE TRUE
WAIT 0
     IF
       0@ == 1
     THEN
         IF
           056D:   actor $PLAYER_ACTOR defined
         THEN
             0B4E: samp 1@ = get_current_dialog_id
             chatmsg "{00FF7F}Dialog ID: %d" -1 1@
         END
   END
END

             
:ON
0@ = 1
print "SCRIPT ACTIVATED" 2000
0B43: samp cmd_ret

:OFF
0@ = 0
print "SCRIPT DESACTIVATED" 2000
0B43: samp cmd_ret
it is the same problem.
cFMSq3F.png



i want when open some dialog show me the id of the same dialog open only,i don't want to scan or show all id of all dialog ingame.
i just want to know the id of dialog when open it.
 

noob213

Active member
Joined
Sep 15, 2017
Messages
88
Reaction score
6
Fxed this if it works:D

Code:
{$CLEO}
{$NOSOURCE}

thread "DIALOGID"

:Load    
wait 0
if
samp.Available()
004D: jump_if_false @Load

0B34: samp register_client_command "didon" to_label @ON
0B34: samp register_client_command "didoff" to_label @OFF

:Dialog
wait 0
if
0@ == 1                       
004D: jump_if_false @Dialog
if
0B4C:  samp is_dialog_active -1
004D: jump_if_false @Dialog
0B4E: samp 1@ = get_current_dialog_id 
chatmsg "Dialog ID: %d" color 0255127 1@ 
0002: jump @noname

:noname
wait 0
if
0B4C:  samp is_dialog_active -1
004D: jump_if_false @Dialog
0002: jump @noname


:ON
0@ = 1  
print "SCRIPT ACTIVATED" 2000
0B43: samp cmd_ret

:OFF          
0@ = 0
print "SCRIPT DESACTIVATED" 2000
0B43: samp cmd_ret
 

ramez

Active member
Joined
Jun 11, 2015
Messages
120
Reaction score
0
Location
GB
noob213 said:
Fxed this if it works:D

Code:
{$CLEO}
{$NOSOURCE}

thread "DIALOGID"

:Load    
wait 0
if
samp.Available()
004D: jump_if_false @Load

0B34: samp register_client_command "didon" to_label @ON
0B34: samp register_client_command "didoff" to_label @OFF

:Dialog
wait 0
if
0@ == 1                       
004D: jump_if_false @Dialog
if
0B4C:  samp is_dialog_active -1
004D: jump_if_false @Dialog
0B4E: samp 1@ = get_current_dialog_id 
chatmsg "Dialog ID: %d" color 0255127 1@ 
0002: jump @noname

:noname
wait 0
if
0B4C:  samp is_dialog_active -1
004D: jump_if_false @Dialog
0002: jump @noname


:ON
0@ = 1  
print "SCRIPT ACTIVATED" 2000
0B43: samp cmd_ret

:OFF          
0@ = 0
print "SCRIPT DESACTIVATED" 2000
0B43: samp cmd_ret

How f!xed ? maybe you fix incoming warning but sure the id of dialog not: D
0eb1Qxs.png
 

noob213

Active member
Joined
Sep 15, 2017
Messages
88
Reaction score
6
ramez said:
noob213 said:
Fxed this if it works:D

Code:
{$CLEO}
{$NOSOURCE}

thread "DIALOGID"

:Load    
wait 0
if
samp.Available()
004D: jump_if_false @Load

0B34: samp register_client_command "didon" to_label @ON
0B34: samp register_client_command "didoff" to_label @OFF

:Dialog
wait 0
if
0@ == 1                       
004D: jump_if_false @Dialog
if
0B4C:  samp is_dialog_active -1
004D: jump_if_false @Dialog
0B4E: samp 1@ = get_current_dialog_id 
chatmsg "Dialog ID: %d" color 0255127 1@ 
0002: jump @noname

:noname
wait 0
if
0B4C:  samp is_dialog_active -1
004D: jump_if_false @Dialog
0002: jump @noname


:ON
0@ = 1  
print "SCRIPT ACTIVATED" 2000
0B43: samp cmd_ret

:OFF          
0@ = 0
print "SCRIPT DESACTIVATED" 2000
0B43: samp cmd_ret

How f!xed ? maybe you fix incoming warning but sure the id of dialog not: D
0eb1Qxs.png

this is a condition if you find an open dialog the code goes beyond

if
0B4C: samp is_dialog_active -1
then


0B4E: 0 @ // get the open dialog id
 
chatmsg "DIALOG ID% d" 0@ // %d 0@ parameters displays the dialog id obtained by opcode 0B43

try opening with another dialog should give a different id if the server has no protection for that

this script works perfectly
 

noob213

Active member
Joined
Sep 15, 2017
Messages
88
Reaction score
6
Open sanny builder press F10 then on the formats tab choose the option to convert case: As it is then compile your cleo and test it

RHYOdDo.jpeg
 

Attachments

  • Get-Dialog-ID.cs
    17.4 KB · Views: 20

ramez

Active member
Joined
Jun 11, 2015
Messages
120
Reaction score
0
Location
GB
supahdupahnubah said:
ramez said:
supahdupahnubah said:
Set case converting to "As is"

you mean .asi ? if you mean that not work nt good.
 
no any good helper here ? noob'z

if you'd know how to read, you'd already solve your problem
:gtfo:

I'm sorry because i say in many time i'm noob also i think you talk about this files:
HeXztAE.png



noob213 said:
Open sanny builder press F10 then on the formats tab choose the option to convert case: As it is then compile your cleo and test it
  
ok thanks bro and sry bcs i'm noob<but why some server have the same id of all dialogs and other server have different id to anyone dialog ?
 
Status
Not open for further replies.
Top