carrespawn command
#8

Код:
stock Engine_SET(playerid, vid, State)
{

	GetVehicleParamsEx(vid, Engine[vid], Lights[vid], alarm[vid], doors[vid], bonnet[vid], boot[vid], objective[vid]);
	if(Engine[vid] == State) return 1;
    if(Engine[vid] == 0 || Engine[vid] && State == 1)
    {
    	static Float:VehicleHP;
    	GetVehicleHealth(vid, VehicleHP);
    	if(VehicleHP <= 300.0) return SendLocalMessage(playerid, "* A motor nem indul be, miutбn sъlyos sйrьlйseket szenvedett. *", Range_Normal, COLOR_RP, COLOR_RP);
    	if(Vehicles[vid][Fuel] <= 0) return SendLocalMessage(playerid, "* A motor nem indul be a kevйs ьzemanyag miatt. *", Range_Normal, COLOR_RP, COLOR_RP);
		SetVehicleParamsEx(vid,1,Lights[vid],alarm[vid],doors[vid],bonnet[vid],boot[vid],objective[vid]);
		Engine[vid] = 1;
		KillTimer(Vehicles[vid][FuelTimer]);
		Vehicles[vid][FuelTimer] = SetTimerEx("ReduceFuel", MINUTES(1), true, "d", vid);
		GameTextForPlayer(playerid, "~g~Engine On!", 2000, 4);
		return 1;
    }
    else if(Engine[vid] == 1 && State == 0)
    {
		SetVehicleParamsEx(vid,0,Lights[vid],alarm[vid],doors[vid],bonnet[vid],boot[vid],objective[vid]);
        Engine[vid] = 0;
        KillTimer(Vehicles[vid][FuelTimer]);
        return 1;
    }
    //printf("vid = %d, state: %d, playerid: %d, engine: %d", vid, State, playerid, Engine[vid]);
	return 1;
}
Reply


Messages In This Thread
carrespawn command - by reddoxx - 01.08.2018, 13:25
Re: carrespawn command - by Rufio - 01.08.2018, 13:27
Re: carrespawn command - by reddoxx - 01.08.2018, 13:35
Re: carrespawn command - by Rufio - 01.08.2018, 13:41
Re: carrespawn command - by Dayrion - 01.08.2018, 14:21
Re: carrespawn command - by reddoxx - 01.08.2018, 14:58
Re: carrespawn command - by Rufio - 01.08.2018, 15:18
Re: carrespawn command - by reddoxx - 01.08.2018, 16:18
Re: carrespawn command - by Dayrion - 01.08.2018, 17:02
Re: carrespawn command - by reddoxx - 02.08.2018, 11:42

Forum Jump:


Users browsing this thread: 1 Guest(s)