{$CLEO}
0000:
For 30@ = 1 to 2 step=1
wait 0
If 0AFA: is_samp_available
then
if 0AD2: 3@ = player 0@ targeted_actor //IF and SET
then
0B2B: samp 7@ = get_player_id_by_actor_handle 3@
0B25: samp 1@ = get_player_health 7@
0B26: samp 2@ = get_player_armor 7@
0470: 4@ = actor 3@ current_weapon
0B2A: samp 5@ = get_player_ping 7@
0B65: samp 6@ = player 7@ score
0AF8: samp add_message_to_chat "ID %d|LVL %d|%d HP|%d AR|P %d|W %d" color 0xFFFFFF {ID}7@ {LVL}6@ {HP}1@ {AR}2@ {P}5@ {W}4@
end
end
END
0A93: end_custom_thread
Тогда цикл выполнится два раза, после чего скрипт завершится. Вместо цикла for нужен бесконечный while true.В конец вставь 0A93: end_custom_thread
{$CLEO}
0000:
while true
wait 0
0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B57: samp 1@ = player 0@ animation_id
0B58: samp get_animation_name_to 3@ file_to 2@ by_id 1@
0AD3: 4@v = format "ANIM: %s" 3@
0ACD: show_text_highpriority 4@ time 0
end
https://www.blast.hk/wiki/opcodes:0b58Что тут не так? Выдаёт какую-то ошибку при запуске игры.
CLEO:{$CLEO} 0000: while true wait 0 0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 0B57: samp 1@ = player 0@ animation_id 0B58: samp get_animation_name_to 3@ file_to 2@ by_id 1@ 0AD3: 4@v = format "ANIM: %s" 3@ 0ACD: show_text_highpriority 4@ time 0 end
Что тут не так? Выдаёт какую-то ошибку при запуске игры.
CLEO:{$CLEO} 0000: while true wait 0 0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 0B57: samp 1@ = player 0@ animation_id 0B58: samp get_animation_name_to 3@ file_to 2@ by_id 1@ 0AD3: 4@v = format "ANIM: %s" 3@ 0ACD: show_text_highpriority 4@ time 0 end
:CMD
0B35: samp 0@ = get_last_command_params
0C1A: 0@ = atoi 0@
IF 0B23: samp is_player_connected 0@
THEN
IF 0B20: samp 3@ = actor_handle_by_samp_player_id 0@
THEN
0B25: samp 1@ = get_player_health 0@
0B26: samp 2@ = get_player_armor 0@
0470: 4@ = actor 3@ current_weapon
0B2A: samp 5@ = get_player_ping 0@
0B65: samp 6@ = player 0@ score
0B36: samp 9@ = get_player_nickname 0@
0AB1: call @get_weapon_name_by_id 1 id 4@ to 4@
0AF8: samp add_message_to_chat "Íèê: %s|LVL: %d|HP: %d|AR: %d|P: %d|Weap: %s" color 0xFFFFFF {íèê}9@ {LVL}6@ {HP}1@ {AR}2@ {P}5@ {W}4@
If 00DF: actor 3@ driving
then
03C0: 7@ = actor 3@ car
02E3: 8@ = car 7@ speed
0AF8: samp add_message_to_chat " speed %s player %.1f" 0xFFFFFF {speed}9@ {player:}8@
else
0AF8: samp add_message_to_chat " Èãðîê íå â ìàøèíå"
END
END
END
0B43: samp cmd_ret
// 0AB1: call @get_weapon_name_by_id 1 id 0@ to 1@
:get_weapon_name_by_id
{
Params:
In: 0@ - WeaponID
Out: 1@ - weaponName
Example: call @get_weapon_name_by_id 1 id 0@ to 1@
}
0AC6: 11@ = label @weapons offset
4@ *= 19
005A: 11@ += 4@ // (int)
ret 1 11@
:weapons
hex
"Duke" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 0 }
"Brass Knuckles" 00 00 00 00 00 { 1 }
"Golf Club" 00 00 00 00 00 00 00 00 00 00 { 2 }
"Nite Stick" 00 00 00 00 00 00 00 00 00 { 3 }
"Knife" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 4 }
"Baseball" 00 00 00 00 00 00 00 00 00 00 00 { 5 }
"Shovel" 00 00 00 00 00 00 00 00 00 00 00 00 00 { 6 }
"Pool Cue" 00 00 00 00 00 00 00 00 00 00 00 { 7 }
"Katana" 00 00 00 00 00 00 00 00 00 00 00 00 00 { 8 }
"Chainsaw" 00 00 00 00 00 00 00 00 00 00 00 { 9 }
"Dildo" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 10 }
"Dildo" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 11 }
"Dildo" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 12 }
"Dildo" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 13 }
"Flowers" 00 00 00 00 00 00 00 00 00 00 00 00 { 14 }
"Cane" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 15 }
"Grenade" 00 00 00 00 00 00 00 00 00 00 00 00 { 16 }
"Tear Gas" 00 00 00 00 00 00 00 00 00 00 00 { 17 }
"Molotov" 00 00 00 00 00 00 00 00 00 00 00 00 { 18 }
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 19 }
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 20 }
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 21 }
"Pistol" 00 00 00 00 00 00 00 00 00 00 00 00 00 { 22 }
"Silencer" 00 00 00 00 00 00 00 00 00 00 00 { 23 }
"Deagle" 00 00 00 00 00 00 00 00 00 00 00 00 00 { 24 }
"Shotgun" 00 00 00 00 00 00 00 00 00 00 00 00 { 25 }
"SawnOff" 00 00 00 00 00 00 00 00 00 00 00 00 { 26 }
"Spas12" 00 00 00 00 00 00 00 00 00 00 00 00 00 { 27 }
"Tec9" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 28 }
"MP5" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 29 }
"AK47" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 30 }
"M4" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 31 }
"Mac10" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 32 }
"Rifle" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 33 }
"Sniper" 00 00 00 00 00 00 00 00 00 00 00 00 00 { 34 }
"Rocket Launcher" 00 00 00 00 { 35 }
"HS Rocket Launcher" 00 { 36 }
"Flamethrower" 00 00 00 00 00 00 00 { 37 }
"Minigun" 00 00 00 00 00 00 00 00 00 00 00 00 { 38 }
"C4" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 39 }
"Detonator" 00 00 00 00 00 00 00 00 00 00 { 40 }
"Spray" 00 00 00 00 00 00 00 00 00 00 00 00 00 00 { 41 }
"Fire Extinguisher" 00 00 { 42 }
"Camera" 00 00 00 00 00 00 00 00 00 00 00 00 00 { 43 }
"Nightvision" 00 00 00 00 00 00 00 00 { 44 }
"Infrared Vision" 00 00 00 00 { 45 }
"Parachute" 00 00 00 00 00 00 00 00 00 00 { 46 }
end
Можете показать пример как получать id'ы пассажиров?
03C0: 0@ = actor $PLAYER_ACTOR car
0432: 1@ = get_actor_handle_from_car 0@ passenger_seat 0
Потому что функции нужно копировать и не изменять, если ты не знаешь, как они работают. Они, грубо говоря, отдельно выполняются от скрипта. Все переменные внутри тела функции записываются последовательно при её вызове и равны значениям передаваемых параметров.Скрипт получает ид оружия после чего вызывает смену ида на название, но вот беда, какое оружие игрок не держал бы все время показывает "duke" не могу найти косяк
{$CLEO}
Thread "Lesson"
While True
wait 0
1@ = Actor.Health($Player_Actor).
if 1@ <= 90
then
0af9: "/usedrugs 15"
wait 2000
end
end
Для скана строки используетьсяКак сделать чтоб не флудило /usedrugs 15 новичек просто))
И как сделать когда в чате пишет к примеру "привет" использовалась команда /usedrugs 15
CLEO:{$CLEO} Thread "Lesson" While True wait 0 1@ = Actor.Health($Player_Actor). if 1@ <= 90 then 0af9: "/usedrugs 15" wait 2000 end end