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



/engine error - adithegman - 29.08.2013

hello guys i have a problem with this command, it gives me no errors, just doesn't work! please help

Код:
CMD:engine(playerid,params[])
{
    if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"**** You need to login/register first!");
    new veh, engine, lights, alarm, doors, bonnet, boot, objective, Name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,Name,sizeof(Name));
    veh = GetPlayerVehicleID(playerid);
	GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
	if(engine == 1)
	{
		SetVehicleParamsEx(veh,0,0,alarm,doors,bonnet,boot,objective);
		format(string,sizeof(string),"* %s has turned off the car's engine.",Name);
		ProxDetector(playerid, 40.0, string, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF); // green: 0x61E659FF
	}
	else
	if(engine == 0)
	{
		SetVehicleParamsEx(veh,1,1,alarm,doors,bonnet,boot,objective);
		format(string,sizeof(string),"* %s has turned on the car's engine.",Name);
		ProxDetector(playerid, 40.0, string, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF); // green: 0x61E659FF
	}
	return 1;
}



Re: /engine error - xganyx - 29.08.2013

pawn Код:
CMD:engine(playerid,params[])
{
    if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"**** You need to login/register first!");
    new veh, engine, lights, alarm, doors, bonnet, boot, objective, Name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,Name,sizeof(Name));
    veh = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == 1)
    {
        SetVehicleParamsEx(veh,0,0,alarm,doors,bonnet,boot,objective);
        format(string,sizeof(string),"* %s has turned off the car's engine.",Name);
        ProxDetector(playerid, 40.0, string, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF); // green: 0x61E659FF
    }
    else
    {
        SetVehicleParamsEx(veh,1,1,alarm,doors,bonnet,boot,objective);
        format(string,sizeof(string),"* %s has turned on the car's engine.",Name);
        ProxDetector(playerid, 40.0, string, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF); // green: 0x61E659FF
    }
    return 1;
}



Re: /engine error - DanishHaq - 29.08.2013

You could give us the errors.. how are we suppose to know what to do...


Re: /engine error - adithegman - 29.08.2013

man, it gives me no errors!


Re: /engine error - adithegman - 29.08.2013

Quote:
Originally Posted by xganyx
Посмотреть сообщение
pawn Код:
CMD:engine(playerid,params[])
{
    if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"**** You need to login/register first!");
    new veh, engine, lights, alarm, doors, bonnet, boot, objective, Name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,Name,sizeof(Name));
    veh = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == 1)
    {
        SetVehicleParamsEx(veh,0,0,alarm,doors,bonnet,boot,objective);
        format(string,sizeof(string),"* %s has turned off the car's engine.",Name);
        ProxDetector(playerid, 40.0, string, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF); // green: 0x61E659FF
    }
    else
    {
        SetVehicleParamsEx(veh,1,1,alarm,doors,bonnet,boot,objective);
        format(string,sizeof(string),"* %s has turned on the car's engine.",Name);
        ProxDetector(playerid, 40.0, string, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF, 0xFFBFFFFF); // green: 0x61E659FF
    }
    return 1;
}
thanks, it's working