Engine on/ Engine off - 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)
+--- Thread: Engine on/ Engine off (
/showthread.php?tid=404350)
Engine on/ Engine off -
coolmark1995 - 02.01.2013
Hello I was wondering if anyone knew how to script and engine on off command that works good for a rp server
Re: Engine on/ Engine off -
Mr.Anonymous - 02.01.2013
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;
}
AW: Re: Engine on/ Engine off -
IPrototypeI - 02.01.2013
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
Re: Engine on/ Engine off -
Glad2BeHere - 02.01.2013
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
Re: AW: Re: Engine on/ Engine off -
coolmark1995 - 02.01.2013
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?
Re: Engine on/ Engine off -
coolmark1995 - 03.01.2013
bump
Re: Engine on/ Engine off -
Mr.Anonymous - 03.01.2013
You asked for an engine ON/OFF command and I've given the answer.