Engin cmd makes my pawno stopped working
#1

I want to make cmd /engin to turn on/off the engine of vehicles, but i found a problem while i compile the script. The pawno was stopped cause that.
Код:
CMD:engine(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{	
		new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
		vehicleid = GetPlayerVehicleID(playerid);
		if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"Command tersebut tidak dapat digunakan ke kendaraan ini.");
		GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(engine == VEHICLE_PARAMS_ON)
		{
			SetVehicleEngine(vehicleid, playerid);
		}
		else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "Sedang menyalakan mesin, harap tunggu...");
			SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
		}
	}
	return 1;
}
Reply
#2

Works fine here.
Reply
#3

else if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
Reply
#4

Normally, this would be caused by a missing closing bracket or the like. However, there doesn't seem to be anything wrong with this piece of code provided.
Reply
#5

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
else if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
Wow man thanks a lot man, it's solved. Can you help me? i have one problem with TextDraw
Reply
#6

Whats needed Just ask
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)