Lights are bugged!
#6

Quote:
Originally Posted by thomaswilliams
View Post
Here we go budy a whole set

PHP Code:
CMD:car(playeridparams[])
{
    if(
isnull(params))
    {
        
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /car [name]");
        
SendClientMessageEx(playeridCOLOR_GREY"Available names: Status, Engine, Lights, Trunk, Hood, Fuel");
        return 
1;
    }
    if(
strcmp(params"engine"true) == && 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,"This command can't be used in this vehicle.");
        
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        if(
engine == VEHICLE_PARAMS_ON)
        {
            
SetVehicleEngine(vehicleidplayerid);
        }
        else if((
engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
        {
            
SendClientMessageEx(playeridCOLOR_WHITE"Vehicle engine starting, please wait...");
            
SetTimerEx("SetVehicleEngine"10000"dd",  vehicleidplayerid);
        }
    }
    else if(
strcmp(params"lights"true) == && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
        
SetVehicleLights(vehicleidplayerid);
    }
    else if(
strcmp(params"hood"true) == && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new 
vehicleid GetPlayerVehicleID(playerid);
            if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510 || IsAPlane(vehicleid) || IsABike(vehicleid))
            {
                return 
SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
            }
            
SetVehicleHood(vehicleidplayerid);
        }
        else if(!
IsPlayerInAnyVehicle(playerid))
        {
            new 
closestcar GetClosestCar(playerid);
            if(
IsPlayerInRangeOfVehicle(playeridclosestcar5.0))
            {
                if(
GetVehicleModel(closestcar) == 481 || GetVehicleModel(closestcar) == 509 || GetVehicleModel(closestcar) == 510 || IsAPlane(closestcar) || IsABike(closestcar))
                {
                    return 
SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used on this vehicle.");
                }
                
SetVehicleHood(closestcarplayerid);
            }
        }
    }
    else if(
strcmp(params"trunk"true) == 0)
      {
        if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new 
vehicleid GetPlayerVehicleID(playerid);
            if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510)
            {
                return 
SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
            }
            
SetVehicleTrunk(vehicleidplayerid);
        }
        else if(!
IsPlayerInAnyVehicle(playerid))
        {
            new 
closestcar GetClosestCar(playerid);
            if(
IsPlayerInRangeOfVehicle(playeridclosestcar5.0))
            {
                if(
GetVehicleModel(closestcar) == 481 || GetVehicleModel(closestcar) == 509 || GetVehicleModel(closestcar) == 510)
                {
                    return 
SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used on this vehicle.");
                }
                
SetVehicleTrunk(closestcarplayerid);
            }
        }
    }
     else if(
strcmp(params"fuel"true) == && IsPlayerInAnyVehicle(playerid))
    {
        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 481 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 510) return SendClientMessageEx(playerid,COLOR_RED,"This vehicle doesn't need fuel.");
        if(
GetPVarInt(playerid"fuelonoff") == 0)
        {
            
SendClientMessageEx(playeridCOLOR_WHITE"You have turned on the fuel indicator (green bar).");
            
SetPVarInt(playerid"fuelonoff"1);
            
FuelBar[playerid] = CreateProgressBar(548.0026.0057.503.20866792447100.0);
            
textdrawscount++;
            
SetProgressBarValue(FuelBar[playerid], VehicleFuel[GetPlayerVehicleID(playerid)]);
            
ShowProgressBarForPlayer(playeridFuelBar[playerid]);
        }
        else
        {
            
SendClientMessageEx(playeridCOLOR_WHITE"You have turned off the fuel indicator (green bar).");
            
SetPVarInt(playerid"fuelonoff"0);
            
DestroyProgressBar(FuelBar[playerid]);
            
textdrawscount--;
            
FuelBar[playerid] = INVALID_BAR_ID;
        }
    }
    else if(
strcmp(params"status"true) == 0)
    {
        if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new 
vehicleid GetPlayerVehicleID(playerid);
            new 
engine,lights,alarm,doors,bonnet,boot,objective,enginestatus[4],lightstatus[4], string[48];
            
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            if(
GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_RED,"This vehicle doesn't need fuel.");
            if(
engine != VEHICLE_PARAMS_ONformat(enginestatussizeof(enginestatus), "OFF");
            else 
format(enginestatussizeof(enginestatus), "ON");
            if(
lights != VEHICLE_PARAMS_ONformat(lightstatussizeof(lightstatus), "OFF");
            else 
format(lightstatussizeof(lightstatus), "ON");
            
format(stringsizeof(string), "Engine: %s | Lights: %s | Fuel: %.2f.",enginestatus,lightstatus,VehicleFuel[vehicleid]);
            
SendClientMessageEx(playeridCOLOR_WHITEstring);
        }
    }
    return 
1;

Kinds and Best Regards,
Thomas Williams Owner of Operation Roleplay, Stats Below \/ \/
thats not even gonna work, copy paste simply does not work.
Reply


Messages In This Thread
Lights are bugged! - by Eugene. - 15.10.2013, 12:50
Re: Lights are bugged! - by Blademaster680 - 15.10.2013, 14:01
Re: Lights are bugged! - by Mattakil - 15.10.2013, 14:07
Re: Lights are bugged! - by Unri - 15.10.2013, 14:08
Re: Lights are bugged! - by thomaswilliams - 15.10.2013, 19:30
Re: Lights are bugged! - by Mattakil - 15.10.2013, 23:29
Re: Lights are bugged! - by Ayumi - 15.10.2013, 23:49
Re: Lights are bugged! - by Eugene. - 16.10.2013, 05:11

Forum Jump:


Users browsing this thread: 4 Guest(s)