CLEO Help Cleo Download File

CLEO related

skullempenggg

New member
Joined
Jan 3, 2023
Messages
3
Reaction score
0
Hello
I'm trying to make a mod that will download routes for route recording but it doesn't work... Nothing is downloaded

{$CLEO .cs}

0000: NOP

WAIT 8500

0B34: samp register_client_command "route" to_label @route
20@ = 0

WHILE TRUE
WAIT 0

IF 20@ == 1
THEN
0AC8: 0@ = allocate_memory_size 1024
0AD3: 0@ = "cleo\VehicleRecording.path"
0AC8: 1@ = allocate_memory_size 1024
0AD3: 1@ = "https://www.dropbox.com/s/o0rgvg2m7me64t6/VehicleRecording.path?dl=1"
0AB1: @URLDownloadToFile 2 0@ 1@
0AD1: "~r~Download" time 1337
WAIT 3000
chatmsg "Route Downloaded" -1
20@ = 0
END

END

:URLDownloadToFile
0AA2: 10@ = load_library "Urlmon.dll" // IF and SET
0AA4: 11@ = get_proc_address "URLDownloadToFileA" 10@
0AA7: address 11@ params 5 pop 0 /params/ 0 0 0@ 1@ 0 /ret/ 12@
0AB2: ret 0

:route
wait 0
20@ = 1
chatmsg "Downloading Route" -1
samp.CmdRet()

The problem is that the file isn't downloading in my cleo folder
 

Juli4n

Active member
Joined
Mar 31, 2021
Messages
43
Solutions
1
Reaction score
19
Location
Argentina
Try this link.
Code:
0AD3: 1@ = "https://dl.dropboxusercontent.com/s/o0rgvg2m7me64t6/VehicleRecording.path"
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
CMD: /route
PHP:
{$CLEO .cs}
{$USE bitwise}
{$USE file}
0000:

WAIT 15000

0AC8: 31@ = allocate_memory_size 6 // (r o u t e) = (5) + 1 = 6
0AD3: 31@ = string_format "route"
0AC7: 30@ = var 30@ pointer
0AC7: 29@ = var 29@ pointer
0AB1: @get_samp_version_id 0 _returned: ID 28@
0AB1: @registerClientCommand 4 SampVersionID 28@ _CommandName 31@ _TogglingVar 30@ _ParamsPtrToVar 29@
30@ = 0 // default disabled
29@ = 0 // null ptr

WHILE TRUE
WAIT 0

IF 30@ <> 0
THEN
    30@ = 0
    IF 0AAB:   does_file_exist "CLEO\VehicleRecording.path"
    THEN 0B00: delete_file "CLEO\VehicleRecording.path"
    END       
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = "CLEO\VehicleRecording.path"
    0AC8: 1@ = allocate_memory_size 1024
    // =================================================================================
    // http://www.isgoodstuff.com/dropbox/
    // CONVERT TO "Direct link url"
    // https://www.dropbox.com/s/o0rgvg2m7me64t6/VehicleRecording.path?dl=1
    // https://dl.dropboxusercontent.com/s/o0rgvg2m7me64t6/VehicleRecording.path?dl=1
    // =================================================================================
    0AD3: 1@ = "https://dl.dropboxusercontent.com/s/o0rgvg2m7me64t6/VehicleRecording.path?dl=1"
    0AB1: @URLDownloadToFile 2 0@ 1@ 
    0AC8: 3@ = allocate_memory_size 1024
    0AD3: 3@ = format "Route Downloaded"
    0AB1: @Chatmsg 3 SampVersionID 28@ text 3@ color -1          
END
  
END
0A93: terminate_this_custom_script
 

Attachments

  • Script.cs
    29.3 KB · Views: 11
Top