Invader666
Member
Hello, I'm not very experienced in coding, I mostly just see snippets and try to combine codes. I tried to make a mod which keeps sending command "/towcars" every 11 mins with a textdraw timer, in loop.
I have here 2 files, in file #1 i tried doing this with "show_formatted_text_highpriority" which works fine, but i want it to be textdraw, so i can position the timer above my Minimap.
But (in File #2) when i tried to add textdraw, it doesnt work. I know the code is little fucked up, but I am trying to learn
I have here 2 files, in file #1 i tried doing this with "show_formatted_text_highpriority" which works fine, but i want it to be textdraw, so i can position the timer above my Minimap.
But (in File #2) when i tried to add textdraw, it doesnt work. I know the code is little fucked up, but I am trying to learn
Code:
{$CLEO .cs}
0000:
thread "KeyBind"
0B34: samp register_client_command "att" to_label @cmd
0@ = 0
/// wait 1000 - 1 seconds
/// wait 660000 - 11 minutes
//////
:MAIN
wait 0
if
0@ == 1
then
0AC8: 2@ = allocate_memory_size 260
33@ = 0
const
TIMER_DURATION = 660000
end
while 33@ < TIMER_DURATION
0A8F: 1@ = 33@ - TIMER_DURATION
0012: 1@ *= -1
0016: 1@ /= 1000
0AD1: show_formatted_text_highpriority "Timp: ~r~ %d sec" time 100 1@
wait 100
end
0C8F: samp process_chat_input "/towcars"
wait 100
0AC9: free_allocated_memory 2@
end
SAMP.CmdRet()
jump @MAIN
:CMD
wait 0
if
056D: actor $PLAYER_ACTOR defined
then
0B12: 0@ = 0@ XOR 1
if
0@ == 1
then
0ACD: show_text_highpriority "Auto Tow-Cars: ~g~ON~w~" time 1500
else
0ACD: show_text_highpriority "Auto Tow-Cars: ~r~OFF~w~" time 1500
end
end
SAMP.CmdRet()
jump @MAIN
Code:
{$CLEO .cs}
0000:
thread "KeyBind"
0B34: samp register_client_command "att" to_label @cmd
0@ = 0
/// wait 1000 - 1 seconds
/// wait 660000 - 11 minutes
//////
:MAIN
wait 0
if
0@ == 1
then
0AC8: 2@ = allocate_memory_size 260
33@ = 0
const
TIMER_DURATION = 660000
end
while 33@ < TIMER_DURATION
0A8F: 1@ = 33@ - TIMER_DURATION
0012: 1@ *= -1
0016: 1@ /= 1000
0C48: samp textdraw 155 create "Respawning cars in: ~r~%d" pos 150.5 425.0 1@
0C4E: samp textdraw 155 set_outline 1 color 0xFF000000
0C4A: samp textdraw 155 set_align 3
0C4C: samp textdraw 155 set_style 1
0C52: samp textdraw 155 set_letter_size 0.33 1.2 color 0xFFffffff
0C4B: samp textdraw 155 set_proportional true -1
//0AD1: show_formatted_text_highpriority "Respawning cars in: ~r~ %d " time 100 1@
wait 100
end
0C8F: samp process_chat_input "/towcars"
wait 100
0AC9: free_allocated_memory 2@
end
SAMP.CmdRet()
jump @MAIN
:CMD
wait 0
if
056D: actor $PLAYER_ACTOR defined
then
0B12: 0@ = 0@ XOR 1
if
0@ == 1
then
0ACD: show_text_highpriority "Auto Tow-Cars: ~g~ON~w~" time 1500
else
0ACD: show_text_highpriority "Auto Tow-Cars: ~r~OFF~w~" time 1500
end
end
SAMP.CmdRet()
jump @MAIN