БлагодарюКод:// 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: 1@ = label @weapons offset 0@ *= 19 005A: 1@ += 0@ // (int) ret 1 1@ :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
Еще вопросик, куда это сдесь впихнуть? :СКод:// 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: 1@ = label @weapons offset 0@ *= 19 005A: 1@ += 0@ // (int) ret 1 1@ :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
: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@
0AF8: samp add_message_to_chat "ID %d|%d HP|%d AR|P %d|W %d" color 0xFFFFFF {ID}1@ {HP}1@ {AR}2@ {P}5@ {W}4@
END
END
0B43: samp cmd_ret
Очевидно же, что куда-нибудьЕще вопросик, куда это сдесь впихнуть? :С
CLEO::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@ 0AF8: samp add_message_to_chat "ID %d|%d HP|%d AR|P %d|W %d" color 0xFFFFFF {ID}1@ {HP}1@ {AR}2@ {P}5@ {W}4@ END END 0B43: samp cmd_ret
: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@
call @get_weapon_name_by_id 1 id 4@ to 4@
0AF8: samp add_message_to_chat "ID %d|%d HP|%d AR|P %d|W %s" color 0xFFFFFF {ID}1@ {HP}1@ {AR}2@ {P}5@ {W}4@
END
END
0B43: samp cmd_ret
alloc 15@ 500
while true
wait 0
if 0ADC: test_cheat "P"
then
for 0@ = 0 to 999
if 0B23: samp is_player_connected 0@
then
0B20: samp 1@ = actor_handle_by_samp_player_id 0@
if 056D: actor 1@ defined
then
for 21@ = 0 to 25
0AD3: string_format 4@v format "%d" 21@
if 0AF4: 15@ = read_string_from_ini_file "cleo\id.ini" section "nick" key 4@v
then
0B36: samp 5@ = get_player_nickname 0@
if 0C29: not 20@ = stristr string1 5@ string2 4@
then
0AF8: "%d" -1 0@
end
end
end
end
end
end
end
Без структурных отступов на ответ не стоит расчитывать - код плохо читабеленПочему крашит?
CLEO:alloc 15@ 500 while true wait 0 if 0ADC: test_cheat "P" then for 0@ = 0 to 999 if 0B23: samp is_player_connected 0@ then 0B20: samp 1@ = actor_handle_by_samp_player_id 0@ if 056D: actor 1@ defined then for 21@ = 0 to 25 0AD3: string_format 4@v format "%d" 21@ if 0AF4: 15@ = read_string_from_ini_file "cleo\id.ini" section "nick" key 4@v then 0B36: samp 5@ = get_player_nickname 0@ if 0C29: not 20@ = stristr string1 5@ string2 4@ then 0AF8: "%d" -1 0@ end end end end end end end
Проверил только структуру и исправил ее. (не хватало одного end) Проверяй работает или нет.Почему крашит?
CLEO:alloc 15@ 500 while true wait 0 if 0ADC: test_cheat "P" then for 0@ = 0 to 999 if 0B23: samp is_player_connected 0@ then 0B20: samp 1@ = actor_handle_by_samp_player_id 0@ if 056D: actor 1@ defined then for 21@ = 0 to 25 0AD3: string_format 4@v format "%d" 21@ if 0AF4: 15@ = read_string_from_ini_file "cleo\id.ini" section "nick" key 4@v then 0B36: samp 5@ = get_player_nickname 0@ if 0C29: not 20@ = stristr string1 5@ string2 4@ then 0AF8: "%d" -1 0@ end end end end end end end
while true
wait 0
if 0ADC: test_cheat "P"
then
for 0@ = 0 to 999
if 0B23: samp is_player_connected 0@
then
0B20: samp 1@ = actor_handle_by_samp_player_id 0@
if 056D: actor 1@ defined
then
for 21@ = 0 to 25
0AD3: string_format 4@v format "%d" 21@
if 0AF4: 15@ = read_string_from_ini_file "cleo\id.ini" section "nick" key 4@v
then
0B36: samp 5@ = get_player_nickname 0@
if 0C29: not 20@ = stristr string1 5@ string2 4@
then
0AF8: "%d" -1 0@
end
end
end
end
end
end
end
end
Не работает...Проверил только структуру и исправил ее. (не хватало одного end) Проверяй работает или нет.
CLEO:while true wait 0 if 0ADC: test_cheat "P" then for 0@ = 0 to 999 if 0B23: samp is_player_connected 0@ then 0B20: samp 1@ = actor_handle_by_samp_player_id 0@ if 056D: actor 1@ defined then for 21@ = 0 to 25 0AD3: string_format 4@v format "%d" 21@ if 0AF4: 15@ = read_string_from_ini_file "cleo\id.ini" section "nick" key 4@v then 0B36: samp 5@ = get_player_nickname 0@ if 0C29: not 20@ = stristr string1 5@ string2 4@ then 0AF8: "%d" -1 0@ end end end end end end end end
Он показывает, находится или нет указанный актер в определенном x y радиусе от x y координат, то есть истинными должны быть оба условияКаким образом работает опкод 00EC? Поставил радиус: X: 20, Y:140. В одну сторону всё работает, а в другую - нет...
: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
:1
wait 0
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
0AF8: samp add_message_to_chat "ID %d|LVL %d|%d HP|%d AR|P %d|W %d" color 0xFFFFFF {ID}0@ {LVL}6@ {HP}1@ {AR}2@ {P}5@ {W}4@
00DF: actor 3@ driving
jf @1
03C0: 7@ = actor 3@ car
02E3: 8@ = car 7@ speed
0AF8: samp add_message_to_chat " speed %d player: %.1f" 0xFFFFFF {speed}0@ {player:}8@
jump @1
END
END
0B43: samp cmd_ret
переписал под многоуровневые все пошло, пасиба1) Нельзя использовать задержки в теле команды.
2) Нельзя использовать бесконечные циклы в теле команды (CALLBACK) .
3) Опкод 02E3 возвращает float .
4) Используй высокоуровневые конструкции.
{$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