[Need help] Locking cars
#1

Hey everyone,
I want to script like house cars, but without all those RP things like selling and buying a new car.
I just need to make a certain car only drivable by a certain player and locked for everyone else.
Thanks in advance.

EDIT: If possible, leave an example, I know I'm supposed to use SetVehicleParamsForPlayer, but I don't know how.
Reply
#2

Anyone?
Reply
#3

Код:
Код:
If the person is allowed to use the vehicle.

Код:
SetVehicleParamsForPlayer(vehicleid,playerid,0,0);
Ideally, this should be looped, so all other players get 0,1 (locked)

Код:
for (new i = 0; i <= MAX_PLAYERS; i++)
{
		SetVehicleParamsForPlayer(vehicleid,i,0,1);
}
This will have locked the vehicle for all users, so we need to unlock for people who need to use it. So go ahead and put
Код:
SetVehicleParamsForPlayer(vehicleid,playerid,0,0);
vehicleid = id of the vehicle.
playerid (or i in the second bit of code) is the ID of the player
Then unlock the vehiclefor the correct user later on, using the code above (0,1)
Reply
#4

https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer
Reply
#5

is there a way to use it by OnPlayerStateChange, and if the car is locked it will RemovePlayerFromVehicle, because that setperams way is easily undone with a hack...
Reply
#6

Use a variable.
Reply
#7

Quote:
Originally Posted by Mikep
Use a variable.
What do you mean? please give example...

EDIT: i got some free time right now... im gonna script some lock script... when im done ill post it!

EDIT AGAIN: i got some free time right now... im gonna TRY TO script some lock script... when im done ill post it!
Reply
#8

I already told him how to do it. Why keep posting ¬_¬
Reply
#9

if you read what i put, it said that that way is very easily undone with a hack so where gonna try to do it another way that you cant hack.
Reply
#10

If you have a hack, you'll get into a car. It just teleports you inside it and ignores anything else.

Go learn how hacking actually works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)