CLEO Help Job's Cars

CLEO related
Status
Not open for further replies.

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
Okay, i might be a little stupid by making a billion posts on the same topic. I want to make a dialog which will show how many people are in certain job vehicles. If someone leaves / enters one of those vehicles, obviously the numbers will change. I am having trouble of figuring out how to display this, whether it should be a listbox or static... Can someone help please? @Parazitas @_Safa @monday

Code:
{$CLEO}
{$INCLUDE SF}
0000:
thread "JobsBrowse"

repeat
wait 0
until SAMP.Available()

Dialog.Create(0@, "Job Cars")
Dialog.SetRECT(0@, 1470, 250, 400, 500)
Dialog.SetVisible(0@, 0)

// Job Cars
alloc 11@ 100
alloc 12@ 100
alloc 13@ 100
alloc 14@ 100
alloc 15@ 100
alloc 16@ 100
alloc 17@ 100
// 11@ = Mechanic
0AD3: 11@ = format "Mechanic: %d" 1@
// Dialog.ListBoxInsertElement(0@, 0, 11@, 0, -1)
Dialog.AddStatic(0@, 0, 11@, 0, 0, 0, 10)
// 12@ = Pizza Boy
0AD3: 12@ = format "Pizza Boy: %d" 2@
// Dialog.ListBoxInsertElement(0@, 0, 12@, 1, -1)
Dialog.AddStatic(0@, 0, 12@, 0, 0, 0, 20)
// 13@ = Trucker
0AD3: 13@ = format "Trucker: %d" 3@
// Dialog.ListBoxInsertElement(0@, 0, 13@, 2, -1)
Dialog.AddStatic(0@, 0, 13@, 0, 0, 0, 30)
// 14@ = Bus Driver
0AD3: 14@ = format "Bus Driver: %d" 4@
// Dialog.ListBoxInsertElement(0@, 0, 14@, 3, -1)
Dialog.AddStatic(0@, 0, 14@, 0, 0, 0, 40)
// 15@ = Garbage Man
0AD3: 15@ = format "Garbage Man: %d" 5@
// Dialog.ListBoxInsertElement(0@, 0, 15@, 4, -1)
Dialog.AddStatic(0@, 0, 15@, 0, 0, 0, 50)
// 16@ = Farmer
0AD3: 16@ = format "Farmer: %d" 6@
// Dialog.ListBoxInsertElement(0@, 0, 16@, 5, -1)
Dialog.AddStatic(0@, 0, 16@, 0, 0, 0, 60)
// 17@ = Boat Transporter
0AD3: 17@ = format "Boat Transporter: %d" 7@
// Dialog.ListBoxInsertElement(0@, 0, 17@, 6, -1)
Dialog.AddStatic(0@, 0, 17@, 0, 0, 0, 70)
free 11@
free 12@
free 13@
free 14@
free 15@
free 16@
free 17@

// Job Cars = 0
1@ = 0
2@ = 0
3@ = 0
4@ = 0
5@ = 0
6@ = 0
7@ = 0

0B34: "jobcars" @jobcars

WHILE TRUE
WAIT 0

    FOR 9@ = 0 TO 1000 STEP 1
        IF 0B20: samp 10@ = actor_handle_by_samp_player_id 9@
        THEN
            IF 00DD:   actor 10@ driving_car_with_model #TOWTRUCK
            THEN
                1@ += 1
            END
          
            IF 00DD:   actor 10@ driving_car_with_model #PIZZABOY
            THEN
                2@ += 1
            END
          
            IF OR
            00DD:   actor 10@ driving_car_with_model #PETRO
            00DD:   actor 10@ driving_car_with_model #RDTRAIN
            THEN
                3@ += 1
            END
          
            IF 00DD:   actor 10@ driving_car_with_model #BUS
            THEN
                4@ += 1
            END
          
            IF 00DD:   actor 10@ driving_car_with_model #TRASH
            THEN
                5@ += 1
            END
          
            IF 00DD:   actor 10@ driving_car_with_model #TRACTOR
            THEN
                6@ += 1
            END
          
            IF 00DD:   actor 10@ driving_car_with_model #SPEEDER
            THEN
                7@ += 1
            END
        END
    END
    
      

END

:jobcars
SAMP.IsCommandTyped(20@)
0B12: 1@ = 1@ XOR 1
IF 1@ == 1
THEN
    Dialog.SetVisible(0@, 1)
ELSE
    IF 1@ == 0
    THEN
        Dialog.SetVisible(0@, 0)
    END
END
SAMP.CmdRet()
 
Status
Not open for further replies.
Top