OnPlayerEnterVehicle
#1

I'm just not sure if this is right at all, what im attempting to do is just make a vehicle starts its engine as soon as a player enters a vehicle.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
    return 1;
}
That's what ive got and it should work right?
Reply
#2

Lol you could test it... Should work.
Reply
#3

It should... But if you have ManualVehicleEngineAndLights() in your script just remove that and the engine and lights should be server-controlled.
Reply
#4

try this link
if you do this it should work
Reply
#5

yeah ive got manualvehicleengineandlights on
but when i was testing it earlier on, the car just didnt start.
Reply
#6

try this:
fill the information in that the function requires:
Код:
GetVehicleParamsEx(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);
than change vehicleid to the id from the vehicle you want it to have effect on, for example:
Код:
GetVehicleParamsEx(560, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);
now it gets the engine state

Код:
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
here change vehicleid to the vehicleid you want it to have effect on and change engine to 1, like this:
Код:
SetVehicleParamsEx(560, 1, lights, alarm, doors, bonnet, boot, objective);
try this and i hope it helps ...
Reply
#7

Quote:
Originally Posted by Hobod
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
    return 1;
}
I've already done that, and vehicleid should be the id of the vehicle that they're entering if im right.

EDIT: seems to be working now, not a clue why lol not changed anything from what i put in my first post
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)