SA-MP Forums Archive
[FilterScript] Simple [Engine] and [Lights] Commands - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Simple [Engine] and [Lights] Commands (/showthread.php?tid=476459)



Simple [Engine] and [Lights] Commands - KimGuan - 18.11.2013

Hello,So I Just Created This [/carengine] and [/carlights] System .. Hope You Like It..

Intro and Defines:
Код:
/* ---------------------------------- */
// By: KimGuan
// Release Date: November 19,2013
/* ---------------------------------- */
// Includes
#include <a_samp>
#include <zcmd>
/* ---------------------------------- */

/* ---------------------------------- */
// Defines / Variables
new Engine[MAX_VEHICLES];
new Lights[MAX_VEHICLES];
/* ---------------------------------- */

/* ---------------------------------- */
// Color Defines
#define COLOR_AQUA        0x7CFC00AA
#define COLOR_GREY        0xAFAFAFAA
#define COLOR_GREEN 	  0x33AA33AA
#define COLOR_BRIGHTRED   0xFF0000AA
#define COLOR_DARKRED 	  0xC60000FF
#define COLOR_YELLOW 	  0xFFFF00AA
/* ---------------------------------- */
OnFIlterscriptinit
Код:
/* ---------------------------------- */
public OnFilterScriptInit()
{
    ManualVehicleEngineAndLights();
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	Engine[vehicleid] = 0;
	Lights[vehicleid] = 0;
	return 1;
}
And the Commands:
Код:
CMD:carengine(playerid, params[])
{
    if(strcmp(params,"on",true) == 0)
    {
    	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    	{
			new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
			GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
			SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} ON");
			Engine[Vehicle] = 1, SetVehicleParamsEx(Vehicle, 1, lights, alarm, doors, bonnet, boot, objective);
		}
	}
	if(strcmp(params,"off",true) == 0)
	{
		 if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    	{
			new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
			GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
			SendClientMessage(playerid, COLOR_YELLOW, "You have turned your engine >{FFFFFF} OFF");
			Engine[Vehicle] = 0, SetVehicleParamsEx(Vehicle, 0, lights, alarm, doors, bonnet, boot, objective);
		}
	}
	return 1;
}

CMD:carlights(playerid, params[])
{
    if(strcmp(params,"on",true) == 0)
    {
    	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    	{
			new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
			GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
			SendClientMessage(playerid, COLOR_YELLOW, "You have turned your lights >{FFFFFF} ON");
			Lights[Vehicle] = 1, SetVehicleParamsEx(Vehicle, engine, 1, alarm, doors, bonnet, boot, objective);
		}
	}
	if(strcmp(params,"off",true) == 0)
	{
		 if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    	{
			new Vehicle = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
			GetVehicleParamsEx(Vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
			SendClientMessage(playerid, COLOR_YELLOW, "You have turned your lights >{FFFFFF} OFF");
			Lights[Vehicle] = 0, SetVehicleParamsEx(Vehicle, engine, 0, alarm, doors, bonnet, boot, objective);
		}
	}
	return 1;
}
Hope You Like It

Or Download the .pwn folder
Here


Re: Simple [Engine] and [Lights] Commands - KingServerIRAN - 18.11.2013

nice commands!


Re: Simple [Engine] and [Lights] Commands - KimGuan - 18.11.2013

Quote:
Originally Posted by KingServerIRAN
Посмотреть сообщение
nice commands!
Thank You!


Re: Simple [Engine] and [Lights] Commands - ***Niko*** - 18.11.2013

You should post .pwn file and pastebin recommanded,some peoples will not know to put this in GM or make it as FS since not all done (and they don't "understand") what they should do now


Re: Simple [Engine] and [Lights] Commands - KimGuan - 18.11.2013

Quote:

You should post .pwn file and pastebin recommanded,some peoples will not know to put this in GM or make it as FS since not all done (and they don't "understand") what they should do now

Okay ..