CLEO Help Draw image on screen

CLEO related
Status
Not open for further replies.

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Who know how draw image on game screen?

@monday
@springfield
@supahdupahnubah
etc..
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
Code:
{$CLEO .cs}
0000: NOP
REPEAT
Wait 0
Until Samp.Available

0B34: "test" @TEST
0B00: delete_file "cleo/cleo_saves/test.png"
alloc 5@ 260 

While True
Wait 0
End

:TEST
SAMP.GetScreenResolution(1@, 2@)
1@ -= 420 
2@ -= 250 
3@ = 160 
4@ = 200 
005A: 3@ += 2@  
005A: 4@ += 2@  
format 5@ "http:%c%cpart.lt/img/da3044b69613a11932f0fe96eba1c0b0617.jpg" 47 47
0C65: 21@ = download_url 5@ to_file "cleo/cleo_saves/test.png" 
6@ = -1
0C66: 6@ = get_download 7@ state 
0C7D: release_download 7@ 
0B71: render 8@ = load_texture_from_file "cleo/cleo_saves/test.png" 
0B73: render draw_texture 8@ pos 1@ 2@ size 410 160 rotation 0 color -1
wait 5000
0B00: delete_file "cleo/cleo_saves/test.png"
CmdRet
Just edit, because my script photo removing very fast, and idk why xd
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
kazkaS said:
Code:
{$CLEO .cs}
0000: NOP
REPEAT
Wait 0
Until Samp.Available

0B34: "test" @TEST
0B00: delete_file "cleo/cleo_saves/test.png"
alloc 5@ 260 

While True
Wait 0
End

:TEST
SAMP.GetScreenResolution(1@, 2@)
1@ -= 420 
2@ -= 250 
3@ = 160 
4@ = 200 
005A: 3@ += 2@  
005A: 4@ += 2@  
format 5@ "http:%c%cpart.lt/img/da3044b69613a11932f0fe96eba1c0b0617.jpg" 47 47
0C65: 21@ = download_url 5@ to_file "cleo/cleo_saves/test.png" 
6@ = -1
0C66: 6@ = get_download 7@ state 
0C7D: release_download 7@ 
0B71: render 8@ = load_texture_from_file "cleo/cleo_saves/test.png" 
0B73: render draw_texture 8@ pos 1@ 2@ size 410 160 rotation 0 color -1
wait 5000
0B00: delete_file "cleo/cleo_saves/test.png"
CmdRet
Just edit, because my script photo removing very fast, and idk why xd

1. You create it?
2. You can add wait before delete picture , like.:
[shcode=cpp]
wait 60000 // 1 min
0B00: delete_file "cleo/cleo_saves/test.png"
[/shcode]
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
i created, but what i not created just this lines
Code:
0B71: render 8@ = load_texture_from_file "cleo/cleo_saves/test.png" 
0B73: render draw_texture 8@ pos 1@ 2@ size 410 160 rotation 0 color -1
wait 5000
0B00: delete_file "cleo/cleo_saves/test.png"

btw, wait timer not working  for  me
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
kazkaS said:
i created, but what i not created just this lines
Code:
0B71: render 8@ = load_texture_from_file "cleo/cleo_saves/test.png" 
0B73: render draw_texture 8@ pos 1@ 2@ size 410 160 rotation 0 color -1
wait 5000
0B00: delete_file "cleo/cleo_saves/test.png"

btw, wait timer not working  for  me

In command label never work wait , put code in loop and make it work only one time.
Need help with it?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Why draw work only 10 - 15 sec? after 10-15 sec picture gone... o_O

[shcode=cpp]
{$CLEO .cs}

0000: NOP

REPEAT
Wait 0
Until 0afa:

0B34: "test" @TEST

0B00: delete_file "cleo\cleo_saves\test.png"

SAMP.GetScreenResolution(1@, 2@)
1@ -= 420
2@ -= 250
3@ = 160
4@ = 200
005A: 3@ += 2@  
005A: 4@ += 2@

alloc 5@ 260

While True
Wait 0

if
0AAB:   file_exists "CLEO\cleo_saves\test.png"
then
   03F0: enable_text_draw 1
   0B71: render 8@ = load_texture_from_file "cleo/cleo_saves/test.png"
   0B73: render draw_texture 8@ pos 1@ 2@ size 410 160 rotation 0 color -1
end

End

:TEST
0B35: samp 0@ = get_last_command_params
0B72: render release_texture 8@
0B00: delete_file "cleo\cleo_saves\test.png"  
format 5@ "http:%c%cpart.lt/img/da3044b69613a11932f0fe96eba1c0b0617.jpg" 47 47
0C65: 21@ = download_url 5@ to_file "cleo/cleo_saves/test.png"
6@ = -1
0C66: 6@ = get_download 7@ state
0C7D: release_download 7@
CmdRet
[/shcode]

@monday
@springfield
@supahdupahnubah
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
0B71: render 8@ = load_texture_from_file "cleo/cleo_saves/test.png"
you only need to load it into the memory once (unless you changed it during the runtime)
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
supahdupahnubah said:
0B71: render 8@ = load_texture_from_file "cleo/cleo_saves/test.png"
you only need to load it into the memory once (unless you changed it during the runtime)

Thanks for answer.
 
Status
Not open for further replies.
Top