PDA

View Full Version : Cannot enter a vehicle properly


DizZykeee
18/02/2016, 04:41 PM
Hi all,

I'm busy with scripting a big GameMode but I got at a small problem..
When I try to enter a vehicle for the first time, I have to press "G" to make the animation start to enter the vehicle as a passenger, before I can press "F" to get into the driver seat.

So that means that if I walk around a vehicle, keep pressing "F" to get in, nothing happens. Not even a single small anim or animreset. When I press "G", my character instantly enters the vehicle with the normal animation. When I pressed "G" once to enter a vehicle I can enter THAT vehicle as driver aswell without problems anytime. But when I resetted the server I have to "G" at all vehicles before I'm able to get in the driver seat the normal way.

My vehicle "Lock" system works perfect, which wont allow me to enter when a vehicle really has been Locked for the server. When its Unlocked, I am able to get in as passenger first, before I can get into the vehicle as a driver (the normal way pressing F).

Anybody has any idea how this can occur?

Vince
18/02/2016, 05:21 PM
You might want to check for any stray ClearAnimations statements.

DizZykeee
18/02/2016, 05:24 PM
You might want to check for any stray ClearAnimations statements.

Hey, thanks for the reply. I have checked for that but there isn't any "ClearAnimations(playerid);" at the OnPlayerEnterVehicle callback. Also if I press "G" once to get in as passenger, it works, and after I entered as a passenger, I can enter just THAT vehicle as a driver. But only After I have pressed "G". As if "F" cannot find any vehicles near, but "G" can.

DizZykeee
18/02/2016, 09:19 PM
I fixed it by adding SetVehicleToRespawn(i); in the loop of my /rac command.. So now my vehicles will be Destroyed, Recreated, and then respawned by default system. So there has to be something with my Spawn System but I still wonder what it could be.

My vehicles spawn from loaded Folder\Vehicles\#.ini files which went perfect for a long time (still goes perfect except this small thing).
I use "CreateVehicle(params...);" for my system and still wonder what it can be. Anybody has an idea?

Virtual1ty
18/02/2016, 09:33 PM
Are you using SetVehicleParamsForPlayer (http://wiki.sa-mp.com/wiki/SetVehicleParamsForPlayer)? I guess the same applies to SetVehicleParamsEx(). See the OnVehicleStreamIn() code. You most likely don't have that.