SA-MP Forums Archive
Car engine - 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: Car engine (/showthread.php?tid=403933)



Car engine - geohareas - 01.01.2013

Before you start reading my topic,I would like to wish you to have a happy new year,with love,health and lets hope that every wish will come true!!
Hello,

I was wondering,is there any way to turn automatically ON the vehicle engine,instead of typing /engineon and etc?
I was looking on the SAMP wiki when i found "OnPlayerEnterVehicle" but nothing,i searched it on my script and i found this:

Code:
//==============================================================================

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

//==============================================================================

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

//==============================================================================
Also,found these:
Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new pname[24];
	new string[128];
	GetPlayerName(playerid,pname,sizeof(pname));

	//Save Last Vehicle ID (Detain)
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
	    new engine,lights,alarm,doors,bonnet,boot,objective;
		new vid = GetPlayerVehicleID(playerid);
	    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(engine != VEHICLE_PARAMS_ON && !IsAPlane(vid) && !IsACycleBike(vid))
		{
		    SendClientMessage(playerid,COLOR_DODGERBLUE,"To turn on the vehicle engine type /engineon or s.");
		}
		if(engine != VEHICLE_PARAMS_ON && IsAPlane(vid) && !IsACycleBike(vid))
		{
		    SendClientMessage(playerid,COLOR_DODGERBLUE,"To turn on a plane engine type /engineon.");
		}
		if(engine != VEHICLE_PARAMS_ON && IsACycleBike(vid))
		{
		    SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
		}
	    LastVehicle[playerid] =GetPlayerVehicleID(playerid);
	}
Thanks in advance,for reading my thread!

Best Regards,
George


Re: Car engine - =WoR=Varth - 01.01.2013

https://sampwiki.blast.hk/wiki/ManualVehicleEngineAndLights


Re: Car engine - geohareas - 01.01.2013

So?I got to remove it?Because i already have it..


Re: Car engine - =WoR=Varth - 01.01.2013

Yes remove it.