CLEO Help textdraw problem

CLEO related
Status
Not open for further replies.

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
So i trying to make, when i get texdraw text, its have to say "/dm" the problem is that it doesn't work
Code:
{$CLEO .cs}
0000: NOP
REPEAT
Wait 0
Until 0AFA: is_samp_structures_available
0AC8: 2@ = allocate_memory_size 260
0B34: "ws" @DM
0@ = FALSE

While True
Wait 0
If
0@ == TRUE
Then
If
0C5D: samp textdraw 1@ is_exists
then
0C5A: samp textdraw 1@ get_string_to 2@
if
0C29: $NOT_USED = stristr string1 2@ string2 "War started type /dm"
then 
wait 200
say "/dm"
end
end
end  
END

:DM
0B12: 0@ = 0@ XOR TRUE
If
0@ == TRUE
Then
0ACD: show_text_highpriority "~W~DM: ~G~ON~W~" time 1000 
else
0ACD: show_text_highpriority "~W~DM: ~R~OFF~W~" time 1000
end  
CmdRet


@Monday
@Springfield
@Parazitas
others?

Maybe i missing
1@ += 1
1@ > 4096
?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
[shcode=cpp]
{$CLEO .cs}

0000: NOP

REPEAT
Wait 0
Until 0AFA:

0B34: "ws" @DM

while true
wait 0

for 1@ = 0 to 2304 /// all textdraw ids

if and
0@ == TRUE
0C5D: samp textdraw 1@ is_exists
then
   alloc 2@ = 1024 /// ALLOCATE TO MEMORY GET STRING
   0C5A: samp textdraw 1@ get_string_to 2@
   if 0C29: $NOT_USED = stristr string1 2@ string2 "War started type /dm"
   then
       wait 200
       say "/dm"
   end
   free 2@ // FREE ALLOCATED MEMORY
end

end // end for 1@ = 0 to 2304

END /// end While True

:DM
if
0@ == FALSE
Then
   0@ = TRUE
   0ACD: show_text_highpriority "~W~DM: ~G~ON~W~" time 1000
else
   0@ = FALSE
   0ACD: show_text_highpriority "~W~DM: ~R~OFF~W~" time 1000
end  
CmdRet
[/shcode]
 
Status
Not open for further replies.
Top