Stealing Vehicles

Is it possible to prevent being able to steal every car on the server? would be nice to be able to base it on a % so 20% would be 2 out of 10 cars can be stolen.

2 of 10 is 20% :smiley:
I don’t know how to do that sry

:blush: I’ve not been up too long, but yeah 20%=2 out of 10, I’ve just been reading a thread about it and don’t think it’s possible.

The lock car function exist but i don’t know if it’s possible to apply to some random vehicles, maybe some models are possible.

Perhaps you could use this natives;

Vehicle GET_VEHICLE_PED_IS_TRYING_TO_ENTER(Ped ped) // 814FA8BE5449445D 99968B37

Together with;

void SET_VEHICLE_DOORS_LOCKED(Vehicle vehicle, int doorLockStatus) // B664292EAECF7FA6 4CDD35D0
0 - CARLOCK_NONE
1 - CARLOCK_UNLOCKED
2 - CARLOCK_LOCKED (locked)
3 - CARLOCK_LOCKOUT_PLAYER_ONLY
4 - CARLOCK_LOCKED_PLAYER_INSIDE (can get in, can't leave)

(maybe, these are leftovers from GTA:VC)
5 - CARLOCK_LOCKED_INITIALLY
6 - CARLOCK_FORCE_SHUT_DOORS
7 - CARLOCK_LOCKED_BUT_CAN_BE_DAMAGED

(source: GTA VC miss2 leak, matching constants for 0/2/4, testing)

Then put a possibility of it being locked or unlocked.

1 Like

Yeah use this along with starting a seeded random based on the car colour code and the numbers from the number plate, then you can just do

if math.random > 0.8 then
Lockcar
Else
Unlock car
End

this would lock 20% of cars and it would be the same cars for every player on the server.