Bogach
Активный
- 558
- 27
Хм, об этом чёт не подумал, раньше просто бывало забывал -1 ставить, но работало только цвет был не белый а немного другой.CLEO:then 0af8: "Скрипт Активирован!" -1 else 0af8: "Скрипт Деактивирован!" -1
Завтра попробую.
Хм, об этом чёт не подумал, раньше просто бывало забывал -1 ставить, но работало только цвет был не белый а немного другой.CLEO:then 0af8: "Скрипт Активирован!" -1 else 0af8: "Скрипт Деактивирован!" -1
Я бы сделал так...Хм, об этом чёт не подумал, раньше просто бывало забывал -1 ставить, но работало только цвет был не белый а немного другой.
Завтра попробую.
{$CLEO .cs}
0000: NOP
repeat
wait 400
until SAMP.Available()
if 8AAB: not file_exists "CLEO\tpcoords.ini"
then call @ini_create 0
end
thread "tp"
0C63: register_console_command "tp" to_label @cmd_mycmd
0BDE: pause_thread 0
:cmd_mycmd
0B35: samp 0@ = get_last_command_params
if 0C18: 31@ = strstr string1 0@ string2 "save"
then
Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@)
0AF3: write_float 1@ to_ini_file "CLEO\tpcoords.ini" section "POSITION" key "pos_x"
0AF3: write_float 2@ to_ini_file "CLEO\tpcoords.ini" section "POSITION" key "pos_y"
0AF3: write_float 3@ to_ini_file "CLEO\tpcoords.ini" section "POSITION" key "pos_z"
log "{ffffff}Position[x,y,z] saved: X:%.1f Y:%.1f Z:%.1f" params 1@ 2@ 3@
log "{ffffff}To put actor at position, type - tp"
cmdret
end
if 0C18: 31@ = strstr string1 0@ string2 "pos"
then
0AF2: 4@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_x"
0AF2: 5@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_y"
0AF2: 6@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_z"
Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@)
log "{ffffff}Saved position is: X:%.1f Y:%.1f Z:%.1f" params 4@ 5@ 6@
log "{ffffff}Your curent position is: X:%.1f Y:%.1f Z:%.1f" params 1@ 2@ 3@
cmdret
end
0AF2: 4@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_x"
0AF2: 5@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_y"
0AF2: 6@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_z"
Actor.PutAt($PLAYER_ACTOR, 4@, 5@, 6@)
cmdret
:ini_create
alloc 1@ = 43
format 1@ = "[POSITION]%cpos_x=0.0%cpos_y=0.0%cpos_z=0.0"
0A9A: 0@ = openfile "tpcoords.ini" mode "w"
0AD8: write_string_to_file 0@ from 1@
0A9B: closefile 0@
free 1@
if 0AAB: file_exists "CLEO\tpcoords.ini"
then log "{ffffff}.ini file successfully created"
else
log "{ff0000}Error{ffffff}: .ini file is not found..."
0A93: end_custom_thread
end
ret 0
//by Arkember for BlastHack
//Cheating as art
Учту)Я бы сделал так...
CLEO:{$CLEO .cs} 0000: NOP repeat wait 400 until SAMP.Available() if 8AAB: not file_exists "CLEO\tpcoords.ini" then call @ini_create 0 end thread "tp" 0C63: register_console_command "tp" to_label @cmd_mycmd 0BDE: pause_thread 0 :cmd_mycmd 0B35: samp 0@ = get_last_command_params if 0C18: 31@ = strstr string1 0@ string2 "save" then Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@) 0AF3: write_float 1@ to_ini_file "CLEO\tpcoords.ini" section "POSITION" key "pos_x" 0AF3: write_float 2@ to_ini_file "CLEO\tpcoords.ini" section "POSITION" key "pos_y" 0AF3: write_float 3@ to_ini_file "CLEO\tpcoords.ini" section "POSITION" key "pos_z" log "{ffffff}Position[x,y,z] saved: X:%.1f Y:%.1f Z:%.1f" params 1@ 2@ 3@ log "{ffffff}To put actor at position, type - tp" cmdret end if 0C18: 31@ = strstr string1 0@ string2 "pos" then 0AF2: 4@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_x" 0AF2: 5@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_y" 0AF2: 6@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_z" Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@) log "{ffffff}Saved position is: X:%.1f Y:%.1f Z:%.1f" params 4@ 5@ 6@ log "{ffffff}Your curent position is: X:%.1f Y:%.1f Z:%.1f" params 1@ 2@ 3@ cmdret end 0AF2: 4@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_x" 0AF2: 5@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_y" 0AF2: 6@ = get_float_from_ini_file "CLEO\tpcoords.ini" section "[POSITION]" key "pos_z" Actor.PutAt($PLAYER_ACTOR, 4@, 5@, 6@) cmdret :ini_create alloc 1@ = 43 format 1@ = "[POSITION]%cpos_x=0.0%cpos_y=0.0%cpos_z=0.0" 0A9A: 0@ = openfile "tpcoords.ini" mode "w" 0AD8: write_string_to_file 0@ from 1@ 0A9B: closefile 0@ free 1@ if 0AAB: file_exists "CLEO\tpcoords.ini" then log "{ffffff}.ini file successfully created" else log "{ff0000}Error{ffffff}: .ini file is not found..." 0A93: end_custom_thread end ret 0 //by Arkember for BlastHack //Cheating as art
Все команды пишуться в консоль.
tp - телепортация на ранее сохранённые координаты.
tp save - сохранить координаты.
tp pos - узнать сохранённые координаты и текущую позицию игрока.
"until" - это для цикла repeat, вот тебе несколько возможных проверок на SA:MP.Кстати, я всё не могу понять, в каких случаях надо ставить "until 0afa:" а в каких просто "0afa:" опкод?
while 8AFA: not is_samp_available
wait 400
end
repeat
wait 400
until 0AFA: is_samp_available
:samp
wait 400
if 0AFA: is_samp_available
jf @samp
Спасибо)CLEO:while 8AFA: not is_samp_available wait 400 end repeat wait 400 until 0AFA: is_samp_available :samp wait 400 if 0AFA: is_samp_available jf @samp
Нез, а в свой скрипт можешь ещё добавить...Спасибо)
{$CLEO}
0000:
repeat
wait 0
until samp.Available()
0B34: samp register_client_command "cskin" to_label @cskin
repeat
wait 0
0AC8: 1@ = allocate_memory_size 512
if 0B3C: samp is_dialog_responded id 2 button 0@ list_item 0 input_text 1@
then
if 0@ == 1
then
if and
002D: 1@ <= 1
002D: 1@ >= 299
then chatmsg "Введите корректный ID скина!" -1
else
0AF1: write_int 1@ to_ini_file "cleo\config.ini" section "Chskin" key "Skin:"
0B2B: samp 2@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0AF9: samp say_msg "/skin %d %s" 2@ 1@
0AC9: free_allocated_memory 1@
end
end
end
until false
:cskin
0B3B: samp show_dialog id 2 caption "[Cleo]CheckSkin" text "Введите ID скина." button_1 "-ok-" button_2 "-close-" style 1
samp.CmdRet()
1. Разберём опкод "002d"... 002D: 43@ >= 271@ // (int) - это условие, которое срабатывает если первое число больше второго! Даже если ты сделаешь так: 002d: 43@ vsem_pizda 271, ничего не изменится(ты проста изменил описание).002D: 1@ <= 1
002D: 1@ >= 299
alloc 0@ = 15
0C11: memset destination 0@ value 0 size 15
0C1A: 1@ = atoi 0@
ЗАПОМНИ!!! Я ТЕБЯ НЕ ОСУЖДАЮ)))1. Так как же тогда поставить условие чтобы при вводе числа меньше 1 и больше 299 выдавало ошибку?
2. По поводу памяти, я вкурсе, что выделил чересчур много, потом подкорректировал бы)
3. Спасибо.
4. А чего ты ожидал от новичка?) Я учусь, пытаюсь разобраться в клео скриптинге)
if and
1@ > 1
1@ < 299
then
// ----code
end
С идентификаторами ты напутал) Ты даёшь ему целое число, а говоришь что там строка символов(%s).0AF9: samp say_msg "/skin %d %s" 2@ 1@
Я вижу это так...Так как же тогда поставить условие чтобы при вводе числа меньше 1 и больше 299 выдавало ошибку?
{$CLEO .cs}
const
DIALOG_STYLE_INPUT = 1
end
0000: NOP
repeat
wait 400
until SAMP.Available()
thread "skin"
alloc 1@ = 35
0C11: memset destination 1@ value 0 size 35
0B34: samp register_client_command "cskin" to_label @cmd_skin
while true
wait 0
if 31@ == 1
then
0B3C: samp is_dialog_responded id 16 button 0@ list_item 0 input_text 1@
if 0@ == 1
then
0C1A: 2@ = atoi 1@
if and
2@ > 1
2@ < 299
then
0B2B: samp 3@ = get_player_id_by_actor_handle $PLAYER_ACTOR
say "/skin %d %d" params 3@ 2@
0C11: memset destination 1@ value 0 size 35
31@ = 0
cmdret
else
msg "{ff0000}Error{ffffff}: skin is not found..."
0C11: memset destination 1@ value 0 size 35
31@ = 0
cmdret
end
else
0C11: memset destination 1@ value 0 size 35
31@ = 0
end
end
end
:cmd_skin
0B3B: samp show_dialog id 16 caption "Skin Menu" text "Type skin id..." button_1 "Next" button_2 "Close" style DIALOG_STYLE_INPUT
31@ = 1
cmdret
//by Arkember
//Cheating as art
Я прошлым кодом не воспользовался и этим не воспользуюсь)Я вижу это так...
Конечно это немного неправильно, давать тебе готовый код(но это в последний раз).CLEO:{$CLEO .cs} const DIALOG_STYLE_INPUT = 1 end 0000: NOP repeat wait 400 until SAMP.Available() thread "skin" alloc 1@ = 35 0C11: memset destination 1@ value 0 size 35 0B34: samp register_client_command "cskin" to_label @cmd_skin while true wait 0 if 31@ == 1 then 0B3C: samp is_dialog_responded id 16 button 0@ list_item 0 input_text 1@ if 0@ == 1 then 0C1A: 2@ = atoi 1@ if and 2@ > 1 2@ < 299 then 0B2B: samp 3@ = get_player_id_by_actor_handle $PLAYER_ACTOR say "/skin %d %d" params 3@ 2@ 0C11: memset destination 1@ value 0 size 35 31@ = 0 cmdret else msg "{ff0000}Error{ffffff}: skin is not found..." 0C11: memset destination 1@ value 0 size 35 31@ = 0 cmdret end else 0C11: memset destination 1@ value 0 size 35 31@ = 0 end end end :cmd_skin 0B3B: samp show_dialog id 16 caption "Skin Menu" text "Type skin id..." button_1 "Next" button_2 "Close" style DIALOG_STYLE_INPUT 31@ = 1 cmdret //by Arkember //Cheating as art