CLEO ctOS for samp 0.3.7

Статус
В этой теме нельзя размещать новые ответы.

IZDATXXX

Известный
Автор темы
Проверенный
172
251
Описание:
Информер, выполненный как в Watch Dogs.
Чтобы узнать подробнее об актере/транспорте/объекте удерживайте клавишу X.
fUfmNlX.jpg

RD4SRX7.jpg

qWotdfQ.jpg
Требования:
Cleo 4.3.
Sampfuncs 5.3.3.
Установка:
Поместить файл *.cs в папку CLEO.
Активация / Деактивация:
Клавиша: END.
Автор: Izd4T
 

Вложения

  • ctOS.cs
    23.5 KB · Просмотры: 122

™ ChipFamily

По ту сторону надежды.
5,144
1,980
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Добавь версию с активацией / дезактивацией на команду.
 

IZDATXXX

Известный
Автор темы
Проверенный
172
251
Исходный код:
CLEO:
{$CLEO}
{$NOSOURCE}
0000:
repeat
wait 0
until 0AFA:
//Constants
const
ACTOR_RADIUS    =3600.0
CAR_RADIUS      =3600.0
OBJECT_RADIUS   =3600.0
end
//Variables
1@=0
//Workspace
while true
    wait 0
    if 1@ == 0
    then
        if
        0C89:  key_just_pressed 35
        then
        0B6D: render 0@ = create_font "Arial" height 16 flags 1
        1@=1
        call @GetSubject 1 0@
        0ACD: show_text_highpriority "ct~b~OS~n~~w~Izd4T prod." time 1000
        end
    else
        if
        0C89:  key_just_pressed 35
        then
        0B6E: render release_font 0@
        1@=0
        0ACD: show_text_highpriority "~b~ct~w~OS~n~Izd4T prod." time 1000
        else
        call @GetSubject 1 0@
        end
    end
end

:GetSubject
068D: get_camera_position_to 1@ 2@ 3@
0B5A: get_screen_resolution 4@ 5@
4@/=2
5@/=2
call @GetPlayer 3 0@ 4@ 5@ 10@ 9@ 8@ 7@ 6@
call @GetVehicle 6 0@ 1@ 2@ 3@ 4@ 5@ 20@ 19@ 18@ 17@
call @GetObject 6 0@ 1@ 2@ 3@ 4@ 5@ 30@ 29@ 28@ 27@
if 10@ <> -1
then    //yes player
    if 20@ <> -1
    then    //yes player yes car
        if 30@ <> -1
        then    //yes player yes car yes object
                                                if 001D:   10@ > 20@
                                                then    //not player
                                                    if 001D:   20@ > 30@
                                                    then    //not car
                                                        30@ = -2
                                                        call @DrawSubject 4 4@ 28@ 27@ 0x8000FFFF
                                                        call @DrawSubject 4 4@ 18@ 17@ 0x80FFFFFF
                                                        call @DrawSubject 4 4@ 8@ 7@ 0x80FFFFFF
                                                    else    //not object
                                                        20@ = -2
                                                        call @DrawSubject 4 4@ 28@ 27@ 0x80FFFFFF
                                                        call @DrawSubject 4 4@ 18@ 17@ 0x8000FFFF
                                                        call @DrawSubject 4 4@ 8@ 7@ 0x80FFFFFF                                                       
                                                    end
                                                else    //not car
                                                    if 001D:   10@ > 30@
                                                    then    //not player
                                                        30@ = -2
                                                        call @DrawSubject 4 4@ 28@ 27@ 0x8000FFFF
                                                        call @DrawSubject 4 4@ 18@ 17@ 0x80FFFFFF
                                                        call @DrawSubject 4 4@ 8@ 7@ 0x80FFFFFF
                                                    else    //not object
                                                        10@ = -2
                                                        call @DrawSubject 4 4@ 28@ 27@ 0x80FFFFFF
                                                        call @DrawSubject 4 4@ 18@ 17@ 0x80FFFFFF
                                                        call @DrawSubject 4 4@ 8@ 7@ 0x8000FFFF
                                                    end
                                                end
        else    //yes player yes car not object
                                                if 001D:   10@ > 20@
                                                then    //not player
                                                    20@ = -2
                                                    call @DrawSubject 4 4@ 18@ 17@ 0x8000FFFF
                                                    call @DrawSubject 4 4@ 8@ 7@ 0x80FFFFFF
                                                else    //not car
                                                    10@ = -2
                                                    call @DrawSubject 4 4@ 18@ 17@ 0x80FFFFFF
                                                    call @DrawSubject 4 4@ 8@ 7@ 0x8000FFFF
                                                end
        end
    else    //yes player not car
        if 30@ <> -1
        then    //yes player not car yes object
                                                if 001D:   10@ > 30@
                                                then    //not player
                                                    30@ = -2
                                                    call @DrawSubject 4 4@ 28@ 27@ 0x8000FFFF
                                                    call @DrawSubject 4 4@ 8@ 7@ 0x80FFFFFF
                                                else    //not object
                                                    10@ = -2
                                                    call @DrawSubject 4 4@ 28@ 27@ 0x80FFFFFF
                                                    call @DrawSubject 4 4@ 8@ 7@ 0x8000FFFF
                                                end
        else    //yes player not car not object
                                                10@ = -2
                                                call @DrawSubject 4 4@ 8@ 7@ 0x8000FFFF
        end
    end
else    //not player
    if 20@ <> -1
    then    //not player yes car
        if 30@ <> -1
        then    //not player yes car yes object
                                                if 001D:   20@ > 30@
                                                then    //not car
                                                    30@ = -2
                                                    call @DrawSubject 4 4@ 28@ 27@ 0x8000FFFF
                                                    call @DrawSubject 4 4@ 18@ 17@ 0x80FFFFFF
                                                else    //not object
                                                    20@ = -2
                                                    call @DrawSubject 4 4@ 28@ 27@ 0x80FFFFFF
                                                    call @DrawSubject 4 4@ 18@ 17@ 0x8000FFFF
                                                end
        else    //not player yes car not object
                                                20@ = -2
                                                call @DrawSubject 4 4@ 18@ 17@ 0x8000FFFF
        end
    else    //not player not car
        if 30@ <> -1
        then    //not player not car yes object
                                                30@ = -2
                                                call @DrawSubject 4 4@ 28@ 27@ 0x8000FFFF
        else    //not player not car not object
        end
    end
end
/*
*/
if 10@ == -2
then
call @Manipulate 6 0@ 0 9@ 8@ 7@ 6@
else
    if 20@ == -2
    then
    call @Manipulate 5 0@ 1 19@ 18@ 17@
    else
        if 30@ == -2
        then
        call @Manipulate 5 0@ 2 29@ 28@ 27@
        else
        end
    end
end
0AB2: ret 0

:Manipulate
/*
0@ font
1@ handleType {0 - player, 1 - vehicle, 2 - object}
2@ handle
3@ xPos
4@ yPos
5@ pId (optional)
*/
if 1@ == 0
then
    if
    0AB0:   key_pressed 88
    then
    call @Selector 3 0x80FFFFFF 3@ 4@
    call @Whois 5 0@ 2@ 3@ 4@ 5@
    else
    0B6F: render font 0@ draw_text "WHOIS" pos 3@ 4@ color 0x8000FFFF
    end
else
    if 1@ == 1
    then
        if
        0AB0:   key_pressed 88
        then
        call @Selector 3 0x80FFFFFF 3@ 4@
        call @Detail 4 0@ 2@ 3@ 4@
        else
        0B6F: render font 0@ draw_text "DETAIL" pos 3@ 4@ color 0x8000FFFF
        end
    else
        if 1@ == 2
        then
            if
            0AB0:   key_pressed 88
            then
            call @Selector 3 0x80FFFFFF 3@ 4@
            call @Explore 4 0@ 2@ 3@ 4@
            else
            0B6F: render font 0@ draw_text "EXPLORE" pos 3@ 4@ color 0x8000FFFF
            end
        else
        end
    end
end
0AB2: ret 0

:Selector
0085: 3@ = 1@
0085: 4@ = 2@
2@ -= 16
3@ += 16
0B68: render draw_line_point1 1@ 2@ point2 3@ 4@ width 1 color 0@
2@ += 32
0B68: render draw_line_point1 1@ 2@ point2 3@ 4@ width 1 color 0@
3@ -= 32
0B68: render draw_line_point1 1@ 2@ point2 3@ 4@ width 1 color 0@
2@ -= 32
0B68: render draw_line_point1 1@ 2@ point2 3@ 4@ width 1 color 0@
0AB2: ret 0

:Whois
alloc 30@ 64
alloc 29@ 64
alloc 28@ 64
alloc 27@ 64
alloc 26@ 64
alloc 20@ 64
0B36: samp 25@ = get_player_nickname 4@ 
0B65: samp 24@ = player 4@ score 
0B2A: samp 23@ = get_player_ping 4@
0B25: samp 22@ = get_player_health 4@ 
0B26: samp 21@ = get_player_armor 4@
0470: 19@ = actor 1@ current_weapon
0AD3: 30@ = format "%s [%d]" 25@ 4@
0AD3: 29@ = format "Score: %d" 24@
0AD3: 28@ = format "Ping: %d" 23@
0AD3: 27@ = format "Health: %d" 22@
0AD3: 26@ = format "Armour: %d" 21@
gosub @GetWeaponName
0B6F: render font 0@ draw_text 30@ pos 2@ 3@ color 0x8000FFFF
3@+=16
0B6F: render font 0@ draw_text 29@ pos 2@ 3@ color 0x80FFFFFF
3@+=16
0B6F: render font 0@ draw_text 28@ pos 2@ 3@ color 0x80FFFFFF
3@+=16
0B6F: render font 0@ draw_text 27@ pos 2@ 3@ color 0x80FFFFFF
3@+=16
0B6F: render font 0@ draw_text 26@ pos 2@ 3@ color 0x80FFFFFF
3@+=16
0B6F: render font 0@ draw_text 20@ pos 2@ 3@ color 0x80FFFFFF
free 20@
free 26@
free 27@
free 28@
free 29@
free 30@
0AB2: ret 0

:Detail
0B2C: samp 30@ = get_vehicle_id_by_car_handle 1@
alloc 29@ 64
alloc 28@ 64
alloc 27@ 64
alloc 26@ 64
0441: 25@ car 1@ model
0ADB: 29@ = car_model 25@ name
0227: 24@ = car 1@ health
0AD3: 29@ = format "%s [%d]" 29@ 30@
0AD3: 28@ = format "Health: %d" 24@
if 0ABE:   vehicle 1@ engine_on
then
0AD3: 27@ = format "Engine: On"
else
0AD3: 27@ = format "Engine: Off"
end
09B3: get_car 1@ door_status 23@
0AD3: 26@ = format "Locked: %d" 23@
0B6F: render font 0@ draw_text 29@ pos 2@ 3@ color 0x8000FFFF
3@+=16
0B6F: render font 0@ draw_text 28@ pos 2@ 3@ color 0x80FFFFFF
3@+=16
0B6F: render font 0@ draw_text 27@ pos 2@ 3@ color 0x80FFFFFF
3@+=16
0B6F: render font 0@ draw_text 26@ pos 2@ 3@ color 0x80FFFFFF
free 26@
free 27@
free 28@
free 29@
0AB2: ret 0

:Explore
0176: 30@ = object 1@ Z_angle
0B52: samp 24@ = object_id_by_handle 1@
alloc 29@ 64
alloc 28@ 64
alloc 27@ 64
0AD3: 29@ = format "Traffic light [%d]" 24@
if and
30@ > 240.0
30@ < 330.0
then    //West-East
0AD3: 28@ = format "Head: East"
0AA7: call_function 0x49D3A0 num_params 0 pop 0 26@
else
    if and
    30@ > 60.0
    30@ < 150.0
    then    //East-West
    0AD3: 28@ = format "Head: West"
    0AA7: call_function 0x49D3A0 num_params 0 pop 0 26@
    else
        if and
        30@ >= 150.0
        30@ <= 240.0
        then    //North-South
        0AD3: 28@ = format "Head: South"
        0AA7: call_function 0x49D350 num_params 0 pop 0 26@
        else
            if or  
            30@ <= 60.0
            30@ >= 330.0
            then    //South-North
            0AD3: 28@ = format "Head: North"
            0AA7: call_function 0x49D350 num_params 0 pop 0 26@
            else
            end
        end
    end
end
for 25@ = 8 to 31
08C3: clear 26@ bit 25@
end
if 26@ == 0
then    //green
0AD3: 27@ = format "Color: Green"
else
    if 26@ == 1
    then    //yellow
    0AD3: 27@ = format "Color: Yellow"
    else
        if 26@ == 2
        then    //red
        0AD3: 27@ = format "Color: Red"
        else
        end
    end
end
0B6F: render font 0@ draw_text 29@ pos 2@ 3@ color 0x8000FFFF
3@+=16
0B6F: render font 0@ draw_text 28@ pos 2@ 3@ color 0x80FFFFFF
3@+=16
0B6F: render font 0@ draw_text 27@ pos 2@ 3@ color 0x80FFFFFF
free 27@
free 28@
free 29@
0AB2: ret 0

:DrawSubject
0B68: render draw_line_point1 0@ 0 point2 1@ 2@ width 1 color 3@
0B70: render draw_polygon_pos 1@ 2@ size 16 16 corners 4 rotation 0.5 color 0x80000000
0B70: render draw_polygon_pos 1@ 2@ size 8 8 corners 4 rotation 0.5 color 3@
0AB2: ret 0

:GetPlayer
/*
0@ throughWalls
1@ xSearchPos
2@ ySearchPos
*/
0006: 22@ = -1
for 30@ = 0 to 1000
    if
    0B20: samp 29@ = actor_handle_by_samp_player_id 30@
    then
        00A0: store_actor 29@ position_to 28@ 27@ 26@
        if
        00C2:   sphere_onscreen 28@ 27@ 26@ radius 0.0
        then
            0B55: convert_3D_coords 28@ 27@ 26@ to_screen 25@ 24@
            0509: 23@ = distance_between_XY 1@ 2@ and_XY 25@ 24@
            if 22@ > -1
            then
                if
                001D:   22@ > 23@
                then
                0085: 22@ = 23@
                0085: 21@ = 29@
                0085: 20@ = 25@
                0085: 19@ = 24@
                0085: 18@ = 30@
                end
            else
            0085: 22@ = 23@
            0085: 21@ = 29@
            0085: 20@ = 25@
            0085: 19@ = 24@
            0085: 18@ = 30@
            end
        end
    end
end
0AB2: ret 5 22@ 21@ 20@ 19@ 18@

:GetVehicle
/*
0@ throughWalls
1@ xCamPos
2@ yCamPos
3@ zCamPos
4@ xSearchPos
5@ ySearchPos
*/
0006: 23@ = -1
if
0AE2: 30@ = random_vehicle_near_point 1@ 2@ 3@ in_radius CAR_RADIUS find_next 0 pass_wrecked 1
then 
    repeat
        00AA: store_car 30@ position_to 29@ 28@ 27@
        if
        00C2:   sphere_onscreen 29@ 28@ 27@ radius 0.0
        then
            0B55: convert_3D_coords 29@ 28@ 27@ to_screen 26@ 25@
            0509: 24@ = distance_between_XY 4@ 5@ and_XY 26@ 25@
            if 23@ > -1
            then
                if
                001D: 23@ > 24@
                then
                    0085: 23@ = 24@
                    0085: 22@ = 30@
                    0085: 21@ = 26@
                    0085: 20@ = 25@
                end
            else
                0085: 23@ = 24@
                0085: 22@ = 30@
                0085: 21@ = 26@
                0085: 20@ = 25@
            end
        end
    until 8AE2: not 30@ = random_vehicle_near_point 1@ 2@ 3@ in_radius CAR_RADIUS find_next 1 pass_wrecked 1
end
0AB2: ret 4 23@ 22@ 21@ 20@

:GetObject
/*
0@ throughWalls
1@ xCamPos
2@ yCamPos
3@ zCamPos
4@ xSearchPos
5@ ySearchPos
*/
0006: 23@ = -1
if
0AE3: 30@ = random_object_near_point 1@ 2@ 3@ in_radius OBJECT_RADIUS find_next 0
then
    repeat
        0984: 19@ = object 30@ model
        if or
        19@ == 3855
        19@ == 1352
        19@ == 3516
        19@ == 1283
        19@ == 1315
        19@ == 1351
        19@ == 1350
        19@ == 1284
        then
            /*BEGIN*/
            01BB: store_object 30@ position_to 29@ 28@ 27@
            if
            00C2:   sphere_onscreen 29@ 28@ 27@ radius 0.0
            then
                0B55: convert_3D_coords 29@ 28@ 27@ to_screen 26@ 25@
                0509: 24@ = distance_between_XY 4@ 5@ and_XY 26@ 25@
                if 23@ > -1
                then
                    if
                    001D: 23@ > 24@
                    then
                        0085: 23@ = 24@
                        0085: 22@ = 30@
                        0085: 21@ = 26@
                        0085: 20@ = 25@
                    end
                else
                    0085: 23@ = 24@
                    0085: 22@ = 30@
                    0085: 21@ = 26@
                    0085: 20@ = 25@
                end
            end
            /*END*/
        end
    until 8AE3: not 30@ = random_object_near_point 1@ 2@ 3@ in_radius OBJECT_RADIUS find_next 1
end
0AB2: ret 4 23@ 22@ 21@ 20@

:GetWeaponName
if
19@ == 0
then
0AD3: 20@ = format "Weapon: Fist"
return
end
if
19@ == 1
then
0AD3: 20@ = format "Weapon: Brass knuckles"
return
end
if
19@ == 2
then
0AD3: 20@ = format "Weapon: Golf club"
return
end
if
19@ == 3
then
0AD3: 20@ = format "Weapon: Nightstick"
return
end
if
19@ == 4
then
0AD3: 20@ = format "Weapon: Knife"
return
end
if
19@ == 5
then
0AD3: 20@ = format "Weapon: Baseball bat"
return
end
if
19@ == 6
then
0AD3: 20@ = format "Weapon: Shovel"
return
end
if
19@ == 7
then
0AD3: 20@ = format "Weapon: Pool cue"
return
end
if
19@ == 8
then
0AD3: 20@ = format "Weapon: Katana"
return
end
if
19@ == 9
then
0AD3: 20@ = format "Weapon: Chainsaw"
return
end
if
19@ == 10
then
0AD3: 20@ = format "Weapon: Purple Dildo"
return
end
if
19@ == 11
then
0AD3: 20@ = format "Weapon: Dildo"
return
end
if
19@ == 12
then
0AD3: 20@ = format "Weapon: Vibrator"
return
end
if
19@ == 13
then
0AD3: 20@ = format "Weapon: Silver Vibrator"
return
end
if
19@ == 14
then
0AD3: 20@ = format "Weapon: Flowers"
return
end
if
19@ == 15
then
0AD3: 20@ = format "Weapon: Cane"
return
end
if
19@ == 16
then
0AD3: 20@ = format "Weapon: Grenade"
return
end
if
19@ == 17
then
0AD3: 20@ = format "Weapon: Tear Gas"
return
end
if
19@ == 18
then
0AD3: 20@ = format "Weapon: Molotov Cocktail"
return
end
if
19@ == 19
then
0AD3: 20@ = format "Weapon: Vehicle missile"
return
end
if
19@ == 20
then
0AD3: 20@ = format "Weapon: Hydra flare"
return
end
if
19@ == 21
then
0AD3: 20@ = format "Weapon: Jetpack"
return
end
if
19@ == 22
then
0AD3: 20@ = format "Weapon: 9mm"
return
end
if
19@ == 23
then
0AD3: 20@ = format "Weapon: Silenced 9mm"
return
end
if
19@ == 24
then
0AD3: 20@ = format "Weapon: Desert Eagle"
return
end
if
19@ == 25
then
0AD3: 20@ = format "Weapon: Shotgun"
return
end
if
19@ == 26
then
0AD3: 20@ = format "Weapon: Sawnoff Shotgun"
return
end
if
19@ == 27
then
0AD3: 20@ = format "Weapon: Combat Shotgun"
return
end
if
19@ == 28
then
0AD3: 20@ = format "Weapon: Micro SMG/Uzi"
return
end
if
19@ == 29
then
0AD3: 20@ = format "Weapon: MP5"
return
end
if
19@ == 30
then
0AD3: 20@ = format "Weapon: AK-47"
return
end
if
19@ == 31
then
0AD3: 20@ = format "Weapon: M4"
return
end
if
19@ == 32
then
0AD3: 20@ = format "Weapon: Tec-9"
return
end
if
19@ == 33
then
0AD3: 20@ = format "Weapon: Country Rifle"
return
end
if
19@ == 34
then
0AD3: 20@ = format "Weapon: Sniper Rifle"
return
end
if
19@ == 35
then
0AD3: 20@ = format "Weapon: RPG"
return
end
if
19@ == 36
then
0AD3: 20@ = format "Weapon: HS Rocket"
return
end
if
19@ == 37
then
0AD3: 20@ = format "Weapon: Flamethrower"
return
end
if
19@ == 38
then
0AD3: 20@ = format "Weapon: Minigun"
return
end
if
19@ == 39
then
0AD3: 20@ = format "Weapon: Satchel Charge"
return
end
if
19@ == 40
then
0AD3: 20@ = format "Weapon: Detonator"
return
end
if
19@ == 41
then
0AD3: 20@ = format "Weapon: Spraycan"
return
end
if
19@ == 42
then
0AD3: 20@ = format "Weapon: Fire Extinguisher"
return
end
if
19@ == 43
then
0AD3: 20@ = format "Weapon: Camera"
return
end
if
19@ == 44
then
0AD3: 20@ = format "Weapon: Night Vis Goggles"
return
end
if
19@ == 45
then
0AD3: 20@ = format "Weapon: Thermal Goggles"
return
end
if
19@ == 46
then
0AD3: 20@ = format "Weapon: Parachute"
end 
return
Разрешаю использовать вышеприведенный код в своих разработках с указанием первоначального авторства.
 
  • Нравится
Реакции: quocvinh
Статус
В этой теме нельзя размещать новые ответы.