remove enginesystem
#1

Sir, I need help I want to remove engine system in that filterscript, but I failed alots of time. That engine system was mess with my server engine system. When we enter the vehicle we need to on the engine twice time. Any one of you help me with that system I really thanks to them.




Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define red 0xAA3333AA //Change this to the error color you want.
#define COLOR_PURPLE 0xC2A2DAAA //prox detector color
new gLastCar[MAX_PLAYERS];




stock IsABoat(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 430,446,452,453,454,472,473,484,493,595: return 1;
    }
    return 0;
}

stock IsAPlane(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 460,464,476,511,512,513,519,520,553,577,592,593: return 1;
    }
    return 0;
}

stock IsAHelicopter(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 417,425,447,465,469,487,488,497,501,548,563: return 1;
    }
    return 0;
}

stock IsATrain(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 449,537,538,569,570,590: return 1;
    }
    return 0;
}

stock IsABike(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 448,461,462,463,468,521,522,523,581,586,481,409,510: return 1;
    }
    return 0;
}

stock IsPlayerDriver(playerid)
{
	if(IsPlayerConnected(playerid) && GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
	{
		return 1;
	}
	return 0;
}

stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
	if(IsPlayerConnected(playerid))
	{
		new Float:posx, Float:posy, Float:posz;
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		new invehicle[MAX_PLAYERS];
		new virtualworld = GetPlayerVirtualWorld(playerid);
		new interior = GetPlayerInterior(playerid);
		new vehicleid = GetPlayerVehicleID(playerid);
		new ivehicleid;
		if(vehicleid)
		{
			GetVehiclePos(vehicleid,oldposx,oldposy,oldposz);
		}
		else
		{
			GetPlayerPos(playerid, oldposx, oldposy, oldposz);
			vehicleid = GetPlayerVehicleID(playerid);
		}
		for(new i; i<MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
					if(GetPlayerVirtualWorld(i) == virtualworld)
					{
						if((GetPlayerInterior(i) == interior))
						{
						    if(vehicleid)
						    {
							    if(IsPlayerInVehicle(i,vehicleid))
							    {
	          						invehicle[i] = 1;
								}
							}
							if(!invehicle[i])
							{
							    if(IsPlayerInAnyVehicle(i))
								{
								    ivehicleid = GetPlayerVehicleID(i);
								    GetVehiclePos(ivehicleid,posx,posy,posz);
								} else {
					    			GetPlayerPos(i,posx,posy,posz);
								}
								tempposx = (oldposx -posx);
								tempposy = (oldposy -posy);
								tempposz = (oldposz -posz);
								if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
								{
									SendClientMessage(i, col1, string);
								}
								else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
								{
									SendClientMessage(i, col2, string);
								}
								else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
								{
									SendClientMessage(i, col3, string);
								}
								else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
								{
									SendClientMessage(i, col4, string);
								}
								else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
								{
									SendClientMessage(i, col5, string);
								}
							}
							else
							{
								SendClientMessage(i, col1, string);
							}
						}
					}
				} else {
					SendClientMessage(i, col1, string);
				}
			}
	}
	return 1;
}

public OnFilterScriptInit()
{
	print("\n--------------------------------------------");
	print("| Vehicle Control System - By Jack_Leslie |");
	print("--------------------------------------------\n");
	ManualVehicleEngineAndLights();
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
	{
	new newcar = GetPlayerVehicleID(playerid);
	gLastCar[playerid] = newcar;
	SendClientMessage(playerid, -1, "Type /engine to start your vehicle!"); //Remove if you don't have manual control
	}
return 1;
}

CMD:engine(playerid, params[])
{
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
	if(!IsPlayerDriver(playerid))
	{
		SendClientMessage(playerid,red,"[Vehicle Control] You're not in a Vehicle with an engine!");
		return 1;
	}
		else if(IsPlayerDriver(playerid))
			{
    			if(engine != 1)
				{
				    engine = 1;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's engine {2F991A}on!");
					format(string, sizeof(string), "* %s puts a key into their ignition and turns on their engine.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
				else
				{
				    engine = 0;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's engine {E31919}off!");
					format(string, sizeof(string), "* %s switches the key in their engine turning it off.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
		}
  	return engine;
}

/*CMD:objective(playerid, params[])
{
	new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
	if(!IsPlayerDriver(playerid))
	{
		SendClientMessage(playerid,red,"[Vehicle Control] You're not in a Vehicle to control the lights!");
		return 1;
	}
		else if(IsPlayerDriver(playerid))
			{
    			if(objective != 1)
				{
				    objective = 1;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_ON);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's objective {2F991A}on!");
				    return 1;
				}
				else
				{
				    objective = 0;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_OFF);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's objective {E31919}off!");
				    return 1;
				}
		}
  	return objective;
}*/ // Commented due to Non-RP on Roleplay Servers, feel free to un-comment if you wish to use it.

CMD:lights(playerid, params[])
{
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
	if(!IsPlayerDriver(playerid))
	{
		SendClientMessage(playerid,red,"[Vehicle Control] You're not in a Vehicle to control the lights!");
		return 1;
	}
		else if(IsPlayerDriver(playerid))
			{
    			if(lights != 1)
				{
				    lights = 1;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's lights {2F991A}on!");
					format(string, sizeof(string), "* %s flicks a switch on the dashboard, switching on their lights.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
				else
				{
				    lights = 0;
					SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's lights {E31919}off!");
					format(string, sizeof(string), "* %s flicks a switch on the dashboard, switching off their lights.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
		}
  	return lights;
}

CMD:hood(playerid, params[])
{
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new engine,lights,alarm,doors,bonnet,boot,objective;
    new oldcar = gLastCar[playerid];
	new Float:cX, Float:cY, Float:cZ;
	GetVehicleParamsEx(oldcar, engine, lights, alarm, doors, bonnet, boot, objective);
	GetVehiclePos(oldcar, cX, cY, cZ);
	new vehicleid = GetPlayerVehicleID(playerid);
	if(!IsAPlane(vehicleid) || !IsAHelicopter(vehicleid) || !IsABike(vehicleid) || !IsATrain(vehicleid) || !IsABoat(vehicleid))
	{
		if(IsPlayerDriver(playerid) || IsPlayerInRangeOfPoint(playerid, 5, cX-2, cY, cZ))
			{
    			if(bonnet != 1)
				{
				    bonnet = 1;
					SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've opened the hood!");
					format(string, sizeof(string), "* %s opens up the hood of the car.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
				else
				{
				    bonnet = 0;
					SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
					SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've shut the hood!");
					format(string, sizeof(string), "* %s closes the hood of the car.", sendername);
				    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    return 1;
				}
		}
	}
  	return bonnet;
}

CMD:trunk(playerid, params[])
{
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new engine,lights,alarm,doors,bonnet,boot,objective;
    new oldcar = gLastCar[playerid];
	new Float:cX, Float:cY, Float:cZ;
	GetVehicleParamsEx(oldcar, engine, lights, alarm, doors, bonnet, boot, objective);
	GetVehiclePos(oldcar, cX, cY, cZ);
	new vehicleid = GetPlayerVehicleID(playerid);
	if(!IsAPlane(vehicleid) || !IsAHelicopter(vehicleid) || !IsABike(vehicleid) || !IsATrain(vehicleid) || !IsABoat(vehicleid))
	{
		if(IsPlayerDriver(playerid) || IsPlayerInRangeOfPoint(playerid, 5, cX+2, cY, cZ))
				{
    				if(boot != 1)
					{
				    	boot = 1;
						SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
						SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've opened the trunk!");
						format(string, sizeof(string), "* %s opens up the trunk of the car.", sendername);
				    	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    	return 1;
					}
					else
					{
				    	boot = 0;
						SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
						SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've shut the trunk!");
						format(string, sizeof(string), "* %s closes the trunk of the car.", sendername);
				    	ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				    	return 1;
					}
			}
		}
  	return boot;
}
Sorry for the bad english...
Reply
#2

pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define red 0xAA3333AA //Change this to the error color you want.
#define COLOR_PURPLE 0xC2A2DAAA //prox detector color
new gLastCar[MAX_PLAYERS];




stock IsABoat(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 430,446,452,453,454,472,473,484,493,595: return 1;
    }
    return 0;
}

stock IsAPlane(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 460,464,476,511,512,513,519,520,553,577,592,593: return 1;
    }
    return 0;
}

stock IsAHelicopter(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 417,425,447,465,469,487,488,497,501,548,563: return 1;
    }
    return 0;
}

stock IsATrain(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 449,537,538,569,570,590: return 1;
    }
    return 0;
}

stock IsABike(vehicleid)
{
    switch(GetVehicleModel(vehicleid))
    {
        case 448,461,462,463,468,521,522,523,581,586,481,409,510: return 1;
    }
    return 0;
}

stock IsPlayerDriver(playerid)
{
    if(IsPlayerConnected(playerid) && GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
    {
        return 1;
    }
    return 0;
}

stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        new invehicle[MAX_PLAYERS];
        new virtualworld = GetPlayerVirtualWorld(playerid);
        new interior = GetPlayerInterior(playerid);
        new vehicleid = GetPlayerVehicleID(playerid);
        new ivehicleid;
        if(vehicleid)
        {
            GetVehiclePos(vehicleid,oldposx,oldposy,oldposz);
        }
        else
        {
            GetPlayerPos(playerid, oldposx, oldposy, oldposz);
            vehicleid = GetPlayerVehicleID(playerid);
        }
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                    if(GetPlayerVirtualWorld(i) == virtualworld)
                    {
                        if((GetPlayerInterior(i) == interior))
                        {
                            if(vehicleid)
                            {
                                if(IsPlayerInVehicle(i,vehicleid))
                                {
                                    invehicle[i] = 1;
                                }
                            }
                            if(!invehicle[i])
                            {
                                if(IsPlayerInAnyVehicle(i))
                                {
                                    ivehicleid = GetPlayerVehicleID(i);
                                    GetVehiclePos(ivehicleid,posx,posy,posz);
                                } else {
                                    GetPlayerPos(i,posx,posy,posz);
                                }
                                tempposx = (oldposx -posx);
                                tempposy = (oldposy -posy);
                                tempposz = (oldposz -posz);
                                if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                                {
                                    SendClientMessage(i, col1, string);
                                }
                                else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                                {
                                    SendClientMessage(i, col2, string);
                                }
                                else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                                {
                                    SendClientMessage(i, col3, string);
                                }
                                else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                                {
                                    SendClientMessage(i, col4, string);
                                }
                                else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                                {
                                    SendClientMessage(i, col5, string);
                                }
                            }
                            else
                            {
                                SendClientMessage(i, col1, string);
                            }
                        }
                    }
                } else {
                    SendClientMessage(i, col1, string);
                }
            }
    }
    return 1;
}

public OnFilterScriptInit()
{
    print("\n--------------------------------------------");
    print("| Vehicle Control System - By Jack_Leslie |");
    print("--------------------------------------------\n");
    ManualVehicleEngineAndLights();
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
    {
    new newcar = GetPlayerVehicleID(playerid);
    gLastCar[playerid] = newcar;
    }
return 1;
}

/*CMD:objective(playerid, params[])
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
    if(!IsPlayerDriver(playerid))
    {
        SendClientMessage(playerid,red,"[Vehicle Control] You're not in a Vehicle to control the lights!");
        return 1;
    }
        else if(IsPlayerDriver(playerid))
            {
                if(objective != 1)
                {
                    objective = 1;
                    SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_ON);
                    SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's objective {2F991A}on!");
                    return 1;
                }
                else
                {
                    objective = 0;
                    SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_OFF);
                    SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's objective {E31919}off!");
                    return 1;
                }
        }
    return objective;
}*/
// Commented due to Non-RP on Roleplay Servers, feel free to un-comment if you wish to use it.

CMD:lights(playerid, params[])
{
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
    if(!IsPlayerDriver(playerid))
    {
        SendClientMessage(playerid,red,"[Vehicle Control] You're not in a Vehicle to control the lights!");
        return 1;
    }
        else if(IsPlayerDriver(playerid))
            {
                if(lights != 1)
                {
                    lights = 1;
                    SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
                    SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's lights {2F991A}on!");
                    format(string, sizeof(string), "* %s flicks a switch on the dashboard, switching on their lights.", sendername);
                    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    return 1;
                }
                else
                {
                    lights = 0;
                    SetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
                    SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've turned the vehicle's lights {E31919}off!");
                    format(string, sizeof(string), "* %s flicks a switch on the dashboard, switching off their lights.", sendername);
                    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    return 1;
                }
        }
    return lights;
}

CMD:hood(playerid, params[])
{
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new oldcar = gLastCar[playerid];
    new Float:cX, Float:cY, Float:cZ;
    GetVehicleParamsEx(oldcar, engine, lights, alarm, doors, bonnet, boot, objective);
    GetVehiclePos(oldcar, cX, cY, cZ);
    new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsAPlane(vehicleid) || !IsAHelicopter(vehicleid) || !IsABike(vehicleid) || !IsATrain(vehicleid) || !IsABoat(vehicleid))
    {
        if(IsPlayerDriver(playerid) || IsPlayerInRangeOfPoint(playerid, 5, cX-2, cY, cZ))
            {
                if(bonnet != 1)
                {
                    bonnet = 1;
                    SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
                    SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've opened the hood!");
                    format(string, sizeof(string), "* %s opens up the hood of the car.", sendername);
                    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    return 1;
                }
                else
                {
                    bonnet = 0;
                    SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
                    SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've shut the hood!");
                    format(string, sizeof(string), "* %s closes the hood of the car.", sendername);
                    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    return 1;
                }
        }
    }
    return bonnet;
}

CMD:trunk(playerid, params[])
{
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new oldcar = gLastCar[playerid];
    new Float:cX, Float:cY, Float:cZ;
    GetVehicleParamsEx(oldcar, engine, lights, alarm, doors, bonnet, boot, objective);
    GetVehiclePos(oldcar, cX, cY, cZ);
    new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsAPlane(vehicleid) || !IsAHelicopter(vehicleid) || !IsABike(vehicleid) || !IsATrain(vehicleid) || !IsABoat(vehicleid))
    {
        if(IsPlayerDriver(playerid) || IsPlayerInRangeOfPoint(playerid, 5, cX+2, cY, cZ))
                {
                    if(boot != 1)
                    {
                        boot = 1;
                        SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
                        SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've opened the trunk!");
                        format(string, sizeof(string), "* %s opens up the trunk of the car.", sendername);
                        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        return 1;
                    }
                    else
                    {
                        boot = 0;
                        SetVehicleParamsEx(oldcar,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
                        SendClientMessage(playerid, 0xFFFFFFAA, "[Vehicle Control] You've shut the trunk!");
                        format(string, sizeof(string), "* %s closes the trunk of the car.", sendername);
                        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        return 1;
                    }
            }
        }
    return boot;
}
I just removed the CMD:engine Command and the "Type /engine to start you engine" Message. Hope i could help you.
BTW: Thanks for this pwn code. For me it is really usefull too.
Reply
#3

Dude I tried but not working vehicle not moving...

Can any one else help me with that.

When we use /engine now its not working. Vehicle freeze not moving.
Reply
#4

Than that has nothing to do with the filterscript... in my server everything is working perfectly. Try to add in your Gamemode TogglePlayerControllable(playerid, 1); under your /engine Command.
Reply
#5

Is there any other way, just I want to remove that engine system in that FS, If you want to check this bug try that
Reply
#6

remove this line
pawn Код:
ManualVehicleEngineAndLights();
and it will return to the normal stuff, you guys need to get up to date with the latest functions as this did not freeze the player, it simply did not start the car when they got in it. it was a function added in 0.3c i think
Reply
#7

i don't have it with freeze, i have it with the params, but i thought he had the one with the toggleplayercontrollable
Reply
#8

Quote:
Originally Posted by xXGaryXx
Посмотреть сообщение
i don't have it with freeze, i have it with the params, but i thought he had the one with the toggleplayercontrollable
okay, and removing that line will cause all the /engine commands to not work if there were any, i didn't read that far in the fs
Reply
#9

Dude now that light system not working.

Can any one know how to split the whole fs to make only light system because I need only light system in that Fs.

Please help me.
Reply
#10

okay well to have the lights you also need the engine, you could make it start the engine when the player enters the vehicle, using the OnPlayerEnterVehicle, the lights will automatically come on during the night however
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)