Car Lights
#7

Try this one maybe its better :P
Quote:

command(lights, playerid, params[])
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid = GetPlayerVehicleID(playerid);
new string[128];
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
if(vid != INVALID_VEHICLE_ID)
{
if(lights == VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,a larm,doors,bonnet,boot,objective);
format(string, sizeof(string), "* %s turns off the vehicle lights.", RPName(playerid));
NearByMessage(playerid, NICESKY, string);
}
else
{
if(Vehicles[vid][Battery] >= 1)
{
SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,al arm,doors,bonnet,boot,objective);
format(string, sizeof(string), "* %s turns on the vehicle lights.", RPName(playerid));
NearByMessage(playerid, NICESKY, string);
}
else
{
RemoveTextMessage(playerid);
TextDrawShowForPlayer(playerid, Text:OutOfBattery);
SetTimerEx("RemoveTextMessage", 3500, false, "d", playerid);
}
}
}
return 1;
}

Reply


Messages In This Thread
Car Lights - by Sarra - 03.08.2014, 22:10
Re: Car Lights - by Sarra - 03.08.2014, 22:33
Re: Car Lights - by Vince - 03.08.2014, 22:37
Re: Car Lights - by Sarra - 03.08.2014, 22:47
Re: Car Lights - by alanhutch - 03.08.2014, 22:51
Re: Car Lights - by Sarra - 03.08.2014, 22:58
Re: Car Lights - by Diti1 - 03.08.2014, 23:14

Forum Jump:


Users browsing this thread: 2 Guest(s)