Engine on/ Engine off
#1

Hello I was wondering if anyone knew how to script and engine on off command that works good for a rp server
Reply
#2

I've made one without any checking.
pawn Код:
COMMAND:engineon(playerid, params[])
{
    new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);

        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);  
        SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
    return 1;
}


COMMAND:engineoff(playerid, params[])
{
    new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);

        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
I've made one without any checking.
pawn Код:
COMMAND:engineon(playerid, params[])
{
    new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);

    SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
    return 1;
}


COMMAND:engineoff(playerid, params[])
{
    new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;
    vehicleid = GetPlayerVehicleID(playerid);

    SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
    return 1;
}
But if he want to use that then he have to add
PHP код:
ManualVehicleEngineAndLights(); 
under OnGameModeInit
Reply
#4

No.... He can use that code with with "ManualVehicleEngineAndLights();" , the code u recommended is that when the player enters a vehicle they have to turn the engine on/off and lights on/off manually, because both of them, can be perform automatically upon entering the vehicle.... Same thing for lights at night
Reply
#5

Quote:
Originally Posted by IPrototypeI
Посмотреть сообщение
But if he want to use that then he have to add
PHP код:
ManualVehicleEngineAndLights(); 
under OnGameModeInit
so then how would I implement the manual?
Reply
#6

bump
Reply
#7

You asked for an engine ON/OFF command and I've given the answer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)