Engine problem
#3

This works
Код:
new tmp_engine;
public OnVehicleSpawn(vehicleid)
{
    tmp_engine = 1;
	return 1;
}



CMD:engine(playerid,params[])
{
    if(GetPlayerState(playerid)<= 1) return SendClientMessage(playerid,0xFFFFFF,"You need to be vehicle driver to use this command!");
    {
        new vID=GetPlayerVehicleID(playerid),
            tmp_lights,
			tmp_alarm,
			tmp_doors,
			tmp_bonnet,
			tmp_boot,
			tmp_objective;

        if(tmp_engine == 0)
		{
        SendClientMessage(playerid,0xFFFFFF,"Engine is on!");
  		tmp_engine = 1;
  		SetVehicleParamsEx(vID, 1, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, 0);
		}
		else
		{
        SendClientMessage(playerid,0xFFFFFF,"Engine is off!");
        GetVehicleParamsEx(vID, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
        SetVehicleParamsEx(vID, 0, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, 0);
        tmp_engine = 0;
		}
    }
    return 1;
}
Reply


Messages In This Thread
Engine problem - by MatriXgaMer - 09.01.2014, 09:35
Re: Engine problem - by amirab - 09.01.2014, 10:01
Re: Engine problem - by [TMS]Legena - 09.01.2014, 11:21
Re: Engine problem - by iBots - 09.01.2014, 12:44

Forum Jump:


Users browsing this thread: 1 Guest(s)