[Need help] Locking cars - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Need help] Locking cars (
/showthread.php?tid=71076)
[Need help] Locking cars -
Wheels - 29.03.2009
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.
Re: [Need help] Locking cars -
Wheels - 31.03.2009
Anyone?
Re: [Need help] Locking cars -
Redirect Left - 31.03.2009
Код:
Код:
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)
Re: [Need help] Locking cars -
Mikep - 31.03.2009
https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer
Re: [Need help] Locking cars -
StrickenKid - 31.03.2009
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...
Re: [Need help] Locking cars -
Mikep - 31.03.2009
Use a variable.
Re: [Need help] Locking cars -
StrickenKid - 31.03.2009
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!
Re: [Need help] Locking cars -
Redirect Left - 31.03.2009
I already told him how to do it. Why keep posting ¬_¬
Re: [Need help] Locking cars -
StrickenKid - 31.03.2009
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.
Re: [Need help] Locking cars -
Redirect Left - 31.03.2009
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.