#1 21-01-2010 20:35

knightrider1994
Registered: 14-12-2009
Posts: 13

lock every car, except two types

hey, i want that every car is locked, so the player cant get in the cars, except of bfinjection and the roadtrain....

Offline

#2 22-01-2010 07:20

Den_spb
From: Ленинград
Registered: 23-11-2008
Posts: 941
Website

Re: lock every car, except two types

{$CLEO}
wait 0
while true
    repeat
        wait 0
    until player.Defined($player_char)
    repeat
        wait 0
        0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 4@ closest_ped_to 3@
    until 056E: car 4@ defined
    if
        056D:   actor 3@ defined
    then
        01C2: remove_references_to_actor 3@ 
    end
    0441: 5@ = car 4@ model
    0AA7: call_function 0x4c5aa0 num_params 1 pop 1 5@ 6@ // testing "isModelCar"
    if and
        6@ == true // vehicle is car
        5@ <> 515  // RDTRAIN ID number
        5@ <> 424 // BFINJECT ID number
    then
        if
            056E: car 4@ defined
        then
            car.DoorStatus(4@) = 2 // lock doors
            car.RemoveReferences(4@)
        end
    end
end

Code was edited.

Last edited by Den_spb (26-01-2010 09:56)

Offline

#3 24-01-2010 15:02

knightrider1994
Registered: 14-12-2009
Posts: 13

Re: lock every car, except two types

[large]thank you!!!!!![/large]

edit: dont works.........

Last edited by knightrider1994 (25-01-2010 17:23)

Offline

#4 25-01-2010 21:13

Den_spb
From: Ленинград
Registered: 23-11-2008
Posts: 941
Website

Re: lock every car, except two types

It's strangely. Code doesn't contain mistakes. Try it without other scripts.

Last edited by Den_spb (25-01-2010 21:15)

Offline

#5 30-01-2010 20:08

knightrider1994
Registered: 14-12-2009
Posts: 13

Re: lock every car, except two types

Does it have to be in a cleo?
Or can you put it in the main.scm also?
(i tried in cleo first it donr worked and in the main the game crashs)

Offline

Board footer

Powered by FluxBB