18.08.2016, 12:25
https://sampforum.blast.hk/showthread.php?tid=370677
Really it's not hard to search for some things...
You can set the message to be displayed when OnPlayerEnterVehicle is called. When a person /locks a car you can tell them that it is locked by a player.
You could do a LockedBy[MAX_VEHICLES] array, which could store the ID of the player who last locked it, But by using MAX_VEHICLES though, you won't be using the array efficiently, and there will be excess empty cells.
You could use a LastLockedCar[MAX_PLAYERS], which could store the ID of the vehicle they had last locked, and being that it's 500 Vs the 2000 vehicles, it'll be lighter.
Then you'd just need a for loop to check each player, if the vehicle that the person who tried entering the car, is locked, reporting who it is that has "ownership" over the car.
Really it's not hard to search for some things...
You can set the message to be displayed when OnPlayerEnterVehicle is called. When a person /locks a car you can tell them that it is locked by a player.
You could do a LockedBy[MAX_VEHICLES] array, which could store the ID of the player who last locked it, But by using MAX_VEHICLES though, you won't be using the array efficiently, and there will be excess empty cells.
You could use a LastLockedCar[MAX_PLAYERS], which could store the ID of the vehicle they had last locked, and being that it's 500 Vs the 2000 vehicles, it'll be lighter.
Then you'd just need a for loop to check each player, if the vehicle that the person who tried entering the car, is locked, reporting who it is that has "ownership" over the car.