Getting player need?
#1

hello everyone i wanted to ask you a system like i have join the server and my name is Alex and my ID is 0 i want to make a system if i lock a vehicle and other players when try to steal my vehicle they should get a message with my name like This vehicle is locked by Alex(0) you cant enter it and when i unlock my vehicle and when any other named player lock it then it should say his name and his id that is locked by bla bla bla i don't know how should i store player names and how to update them on every lock and how to show them so please explain me plz ?
Reply
#2

any one?
Reply
#3

When the player leaves, car will still be locked on his name? Or be free?
Reply
#4

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.
Reply
#5

could you explain me more plzz.?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)