Posts: 134
Threads: 23
Joined: Jul 2012
Reputation:
0
That code is bad, the car is still accessible from a specific point, remove him from the vehicle once his state is changed.
Posts: 124
Threads: 29
Joined: Mar 2011
Reputation:
0
Hmm, I wanted to test it before I replied but im getting tag mismatch warnings when I compile..
edit: ah okay, i wasnt too sure of it either but im not a pro scripter so i wasnt sure.
If I do that, he would not look like his trying to get in it but in turn fails because he doesnt have the keys.
I mean theres got to be a way to make it so Skippers have the keys to the boats so they can use it where as
if your not, you dont have keys and you cant get in..
Posts: 134
Threads: 23
Joined: Jul 2012
Reputation:
0
new VBPos[3]; isn't a defined as Float, thats why. Also it can bug your players , use new Float:VBPos[MAX_PLAYERS][3]; and use VBPos[playerid][0] etc.
Posts: 124
Threads: 29
Joined: Mar 2011
Reputation:
0
Yeah I edited my last post.
I basically want it so that the vehicle is locked to someone who doesnt have that particular job.
Posts: 134
Threads: 23
Joined: Jul 2012
Reputation:
0
if two players access a vehicle at the same time, the result won't be the same.
i.e : I'm in LS and you're in SF, we both enter locked vehicle at the same time,some milisec difference, we can end up getting switched places, i'd be in SF, u in LS or, we both at same spot.
If this was C++, then of course it would work 100 or 99.9999%, but SAMP doesn't read this fast as that language does.
EDIT: You can just use setvehicleparamsforplayer functions, or something like that. It locks the vehicle.
Posts: 124
Threads: 29
Joined: Mar 2011
Reputation:
0
oh kay sweet EV007, Would you be able to give me a quit example of what I would be trying to do in the way of using that?
Posts: 124
Threads: 29
Joined: Mar 2011
Reputation:
0
Could I just make it onplayerentervehicle, if they are restricted then:
SetVehicleParamsForPlayer(vehicleid,playerid,0,1); ?
Or maybe I can figure out a way to make it so when you become the job it unlocks then, when you quit it locks it..
Posts: 134
Threads: 23
Joined: Jul 2012
Reputation:
0
The command locks the vehicle for everyone except you. you have to be in the vehicle, if you want to lock the vehicle while its unoccupied, just specify the vehicle id instead of getplayervehicleid
Posts: 124
Threads: 29
Joined: Mar 2011
Reputation:
0
Couldnt I just use
SetVehicleParamsForPlayer(vehicleid,playerid,0,1);
?
Posts: 134
Threads: 23
Joined: Jul 2012
Reputation:
0
It will probably lock the vehicle, but the person will still be able to enter it from FIRST time. it won't work afterwards tho.
Posts: 124
Threads: 29
Joined: Mar 2011
Reputation:
0
hmm i tried it and they could enter it no matter what :/
Is there a way to get around that? To make it function correctly?
Posts: 134
Threads: 23
Joined: Jul 2012
Reputation:
0
Told you, you can lock vehicles by specifying their correct vehicleid in gamemodeinit maybe, or where ever you have them added.
edit: onvehiclestreamin can work fine too
Posts: 124
Threads: 29
Joined: Mar 2011
Reputation:
0
is there a certain way i need to do that?