/************************************************
0AB1: @CheckLicenses 1 scriptname 0@ return: result 1@
Если результат (в переменной 1@) равен 1, то юзер успешно прошел проверку.
if 1@ == 0
then end_thread // "выключаем" скрипт.
end
Засовываем, например, этот файл в папку CLEO\INC\Licenses.txt
Вставляем в самый вниз скрипта ссылку на инклюд.
{$I CLEO\INC\Licenses.txt}
***********************************************/
const
server = "e3zend.zz.mu"
login = "u661640629"
password = ""
end
:CheckLicenses
/************************
0AB1: @CheckLicenses 1 scriptname 0@ return: result 1@
scriptname - название скрипта (ну, как название, уникальное имя, чтобы не путать ключи).
************************/
wait 0
0085: 15@ = 0@
0AC8: 0@ = allocate_memory_size 60
0AC8: 1@ = allocate_memory_size 60
0AC8: 2@ = allocate_memory_size 60
0AD3: 0@ = server
0AD3: 1@ = login
0AD3: 2@ = password
0AB1: @InternetOpen 0 return: hInternet 3@
0AB1: @InternetConnect 4 hInternet 3@ server 0@ user 1@ password 2@ return: hConnection 25@
0AB1: @GetVolumeInformation 0 return: serial 26@
26@ *= -1
0AD3: 0@ = "/SCRIPTS/FILES/%s/CODE/%d.txt" 15@ 26@
0AD3: 1@ = "CLEO/CLEO_TEXT/temp_key.txt"
if 0AB1: @FtpGetFile 3 hConntection 25@ remote_file 0@ local_file 1@
then
28@ = File.Open("CLEO\CLEO_TEXT\temp_key.txt", "rt")
0AD7: read_string_from_file 28@ to 2@ size 60
File.Close(28@)
while 8B00: delete_file "CLEO\CLEO_TEXT\temp_key.txt"
wait 0
end
0AD3: 0@ = "/SCRIPTS/FILES/%s/KEYS/%s.txt" 15@ 2@
if 0AB1: @FtpGetFile 3 hConntection 25@ remote_file 0@ local_file 1@
then
28@ = File.Open("CLEO\CLEO_TEXT\temp_key.txt", "rt")
0ADA: 29@ = scan_file 28@ format "%d" 30@
File.Close(28@)
while 8B00: delete_file "CLEO\CLEO_TEXT\temp_key.txt"
wait 0
end
if 003B: 26@ == 30@
then 27@ = 1
end
end
else
SAMP.ShowDialog(990, "Регистрация юзера", "{FFFFFF}Вы не были найдены в списке зарегестрированых пользователей. Введите ключ, выданный вам продавцом.", "Далее", "Отмена", 1)
repeat
wait 0
until SAMP.DialogRespond(990, 3@, 0, 2@)
if 3@ == 1
then
0C17: 3@ = strlen 2@
if 3@ > 0
then
0AD3: 0@ = "/SCRIPTS/FILES/%s/KEYS/%s.txt" 15@ 2@
0AD3: 1@ = "CLEO/CLEO_TEXT/temp_key.txt"
if 0AB1: @FtpGetFile 3 hConntection 25@ remote_file 0@ local_file 1@
then
28@ = File.Open("CLEO\CLEO_TEXT\temp_key.txt", "rt")
if 0ADA: 29@ = scan_file 28@ format "%d" 20@
then chat " *Такой ключ зарегистрирован!" 0xFF0000
else
File.Close(28@)
while 8B00: delete_file "CLEO\CLEO_TEXT\temp_key.txt"
wait 0
end
28@ = File.Open("CLEO\CLEO_TEXT\temp_key.txt", "wt")
0AD9: write_formatted_text "%d" in_file 28@ 26@
File.Close(28@)
if 0AB1: @FtpPutFile 3 hConntection 25@ local_file 1@ remote_file 0@
then
0AD3: 0@ = "/SCRIPTS/FILES/%s/CODE/%d.txt" 15@ 26@
28@ = File.Open("CLEO\CLEO_TEXT\temp_key.txt", "wt")
0AD8: write_string_to_file 28@ from 2@
File.Close(28@)
if 0AB1: @FtpPutFile 3 hConntection 25@ local_file 1@ remote_file 0@
then
while 8B00: delete_file "CLEO\CLEO_TEXT\temp_key.txt"
wait 0
end
27@ = 1
end
end
end
File.Close(28@)
else chat " *Такого ключа не существует!" 0xFF0000
end
end
else 27@ = 0
end
end
//0AB1: @InternetCloseHandle 1 hConnection 25@
0AB2: ret 1 27@
:GetVolumeInformation
// 0AB1: @GetVolumeInformation 0 return: id 0@
0AA2: 30@ = load_library "kernel32.dll"
0AA4: 29@ = get_proc_address "GetVolumeInformationA" library 30@
0AC7: 1@ = var 0@ offset
0AA5: call 29@ num_params 8 pop 0 0 0 0 0 1@ 0 0 0
0AB2: ret 1 0@
:FtpGetFile
// 0AB1: @FtpGetFile 3 hConntection 0@ remote_file 1@ local_file 2@ // IF or SET
0AA2: 17@ = load_library "wininet.dll"
0AA4: 18@ = get_proc_address "FtpGetFileA" library 17@
0AA7: call_function 18@ num_params 7 pop 0 {context}0 {flags}0 {attribugs}128 {fail}0 {localfile}2@ {remotefile}1@ {connect}0@ 3@
if 3@ == 1
then 0485: return_true
end
0AB2: return 0
:FtpPutFile
// 0AB1: @FtpPutFile 3 hConntection 0@ local_file 1@ remote_file 2@ // IF or SET
0AA2: 17@ = load_library "wininet.dll"
0AA4: 18@ = get_proc_address "FtpPutFileA" library 17@
0AA7: call_function 18@ num_params 5 pop 0 0 1 2@ 1@ 0@ 3@
if 3@ == 1
then 0485: return_true
end
0AB2: return 0
:InternetConnect
// 0AB1: @InternetConnect 4 hInternet 0@ server 1@ user 2@ password 3@ return: hConnection 4@
0AA2: 17@ = load_library "wininet.dll"
0AA4: 18@ = get_proc_address "InternetConnectA" library 17@
0AA7: call_function 18@ num_params 8 pop 0 0 0x08000000 1 3@ 2@ 21 1@ 0@ 4@
0AB2: return 1 4@
:InternetOpen
// 0AB1: @InternetOpen 0 return: hInternet 0@
0AA2: 17@ = load_library "wininet.dll"
0AA4: 18@ = get_proc_address "InternetOpenA" library 17@
0AA7: call_function 18@ num_params 5 pop 0 0 0 0 1 0 0@
0AB2: return 1 0@