help modifying this cleo script

NEWGATE

Новичок
Автор темы
1
0
hello, please i need a little help with this cleo mode its a simple code when /att is sent a time counter starts for 60 seconds the modification i would like to be adde to is when /att is sent the /towcars comand sent with every 60 seconds, im newbie in cleo i really need some help


{$CLEO .cs}

0000: NOP

REPEAT
WAIT 1000
0A8D: 31@ = readMem 0xC8D4C0 sz 4 vp 0
UNTIL 31@ == 9 // SAMP_IS_READY

0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED098' 30 @
0AA5: call 0x718600 2 pop 2 30@ "Respawning cars in: ~1~ sec"

32@ = 0 // keep timer active

while true
wait 0

if
0256: player $PLAYER_CHAR defined
then
0AB1: @GetLastSentTextFromChatBox 0 _Return: Command 0@ Text 1 @
0AC8: 2@ = allocate_memory_size 260
0AD3: 2@ = format "att" // format to check command
if
0AB1: @IfTextContains 2 String1 0@ String2 2@ _returned: Text 3 @
then
0A8C: write_memory 1@ size 1 value 0 virtual_protect 0 // clear last enter text
32@ = 0 // start count only when text is detected
30@ = true // enable draw text
end
end

if
30@ == true
then
03F0: enable_text_draw 1
0342: set_text_draw_centered 1
03E0: draw_text_behind_textures 0
0349: set_text_draw_font 1
0340: set_text_draw_RGBA 255 255 255 255
033F: set_text_draw_letter_size width 0.255 height 0.955
081C: draw_text_outline 1 RGBA 10 10 10 255
0AB1: @timer 2 Seconds 66 TimingVariable 32@ _Return: TimeLeft 29@ SetTimeCountEndStatus 30 @
045A: draw_text_1number 320.0 390.0 GXT 'CRED098' numbers 29@ // Respawning cars in: ~1~ sec
end

end

:GetLastSentTextFromChatBox
{
0.3.7 - R1
0AB1: @GetLastSentTextFromChatBox 0 _Return: 0 @
}
if 0AA2: 2@ = "samp.dll"
then
0A8E: 3@ = 2@ + 0x21A0E8
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x14E5 // command
0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5 @

:IfTextContains
0AB1: @IfTextContains 2 String1 0@ String2 1 @
0AB1: @strlen 1 string 0@ _length 31 @
0AB1: @strlen 1 string 1@ _length 30 @

initial length check (the phrase can't be longer than the main text)
if 001D: 30@ > 31@ // (int)
then
059A: return_false
0AB2: ret 1 0
end

31@ -= 1
26@ = 0 // counter of the same chars in a row
for 29@ = 0 to 31@ // for each char of the main text (29@ = index)
0085: 24@ = 0@ // (int)
005A: 24@ += 29@ // (int)
0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0

0085: 23@ = 1@ // (int)
005A: 23@ += 26@ // (int)
0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0

if 003B: 28@ == 27@ // (int)
then
26@++
if 002D: 26@ >= 30@ // (int)
then
0485: return_true
0062: 24@ -= 30@ // (int)
24@ += 1
0AB2: ret 1 24 @
end
else
if 26@ > 0
then
29@-- //check the same char again and assume it's the begining of the string but only if there was matching parts before (otherwise it would go back all the time and make infinite loop)
end
26@ = 0
end
end

059A: return_false
0AB2: ret 1 0

:strlen
0AB1: @strlen 1 string 1@ _return: size 3 @
for 1@ = 0 to 1024
0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
if not 2@ == 0
jf break
0@ += 1
end
0AB2: ret 1 1 @

:Timer
2@ = TRUE
IF
2@ == TRUE
THEN
0@ *= 1000
0085: 4@ = 0@ // (int)
0085: 3@ = 1@ // (int)
0062: 3@ -= 4@ // (int)

3@ /= 1000

3@ *= -1
END

IF AND
2@ == TRUE
001D: 1@ > 0@ // (int)
THEN
2@ = FALSE
END
0AB2: ret 2 3@ 2 @