Help [CLEO] Need help in checking string if its equat to something

Dollar

Member
Joined
Aug 11, 2024
Messages
7
Reaction score
1
CSS:
:rpassistance_3
0AC9: free_allocated_memory $samp 
IF
0AA2: $samp = "samp.dll"
then
0A8E: $SAMP_DIALOG_INFO_OFFSET = $samp + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
0A8D: $SAMP_DIALOG_INFO_OFFSET = readMem $SAMP_DIALOG_INFO_OFFSET sz 4 vp 0
0A8E: $SAMP_DIALOG_ACTIVE_OFFSET = $SAMP_DIALOG_INFO_OFFSET + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
0A8D: $SAMP_DIALOG_ACTIVE_OFFSET = readMem $SAMP_DIALOG_ACTIVE_OFFSET sz 4 vp 0
end

if
$SAMP_DIALOG_ACTIVE_OFFSET == true
goto_if_false @rpassistance_1   
0A8E: $SAMP_DIALOG_CAPTION_OFFSET = $SAMP_DIALOG_INFO_OFFSET + 0x40 // SAMP_DIALOG_CAPTION_OFFSET
0AD1: show_formatted_text_highpriority "%s" TIME 10 $SAMP_DIALOG_CAPTION_OFFSET
06D1: v$Vehicle_Lock = "Vehicle Lock"

if
08F9:   $SAMP_DIALOG_CAPTION_OFFSET == v$Vehicle_Lock
goto_if_false @rpassistance_1
0AD1: show_formatted_text_highpriority "~r~%s" TIME 10 $SAMP_DIALOG_CAPTION_OFFSET
jump @rpassistance_1

And it seems I can't use 08F9 to compare whether the $SAMP_DIALOG_CAPTION_OFFSET is equal to v$Vehicle_Lock (I have also tried using "Vehicle Lock" instead of the v$vlock).
I use samp version of 0.3DL.
I use 0AD1 for only experimental purpose to check if its working as intended.
Help me, please..
 
Solution
Sorry bro, butI can't code much, been doing cleo instead and I don't even understand lua thing (install + where to put the mod thing).
wait 7000 0AB1: @get_samp_version_id 0 _returned: ID 31@ //Main loop while true wait 0 IF 0AB1: @is_dialog_active 1 CheckingState true then 0AB1: @get_dialog_caption 1 SampVersionID 31@ _Returned: Caption 30@ 0AC8: 29@ = allocate_memory_size 260 0AD3: 29@ = format "Vehicle Lock" if 0AB1: call @cmpString1andString2 2 30@ 29@ then // UR CODE WHAT TO DO AFTER Dialog opened printf "Dialog with caption: Vehicle lock is opened" time 1000 end free 29@ end end

Ice555

Active member
Joined
Mar 11, 2021
Messages
49
Solutions
3
Reaction score
7
Location
Lithuania
Sorry bro, butI can't code much, been doing cleo instead and I don't even understand lua thing (install + where to put the mod thing).
wait 7000 0AB1: @get_samp_version_id 0 _returned: ID 31@ //Main loop while true wait 0 IF 0AB1: @is_dialog_active 1 CheckingState true then 0AB1: @get_dialog_caption 1 SampVersionID 31@ _Returned: Caption 30@ 0AC8: 29@ = allocate_memory_size 260 0AD3: 29@ = format "Vehicle Lock" if 0AB1: call @cmpString1andString2 2 30@ 29@ then // UR CODE WHAT TO DO AFTER Dialog opened printf "Dialog with caption: Vehicle lock is opened" time 1000 end free 29@ end end
 

Attachments

  • Dialog.cs
    8.7 KB · Views: 2
Solution

Dollar

Member
Joined
Aug 11, 2024
Messages
7
Reaction score
1
wait 7000 0AB1: @get_samp_version_id 0 _returned: ID 31@ //Main loop while true wait 0 IF 0AB1: @is_dialog_active 1 CheckingState true then 0AB1: @get_dialog_caption 1 SampVersionID 31@ _Returned: Caption 30@ 0AC8: 29@ = allocate_memory_size 260 0AD3: 29@ = format "Vehicle Lock" if 0AB1: call @cmpString1andString2 2 30@ 29@ then // UR CODE WHAT TO DO AFTER Dialog opened printf "Dialog with caption: Vehicle lock is opened" time 1000 end free 29@ end end
works like a charm now, thanks. Im gonna put u next to parazitas in the credit haha
 
Top