Errors constant expression & loose identation
#1

Hi all,

Could anyone maybe help me fixing this 2 errors

(on line 8 ) : warning 217: loose indentation

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	{
	// If the player picks up the Buy_License pickup at the driving school in Doherty
	if (pickupid == Pickup_License)
	// Ask the player which license he wants to buy
	ShowPlayerDialog(playerid, DialogBuyLicenses, DIALOG_STYLE_LIST, TXT_DialogLicenseTitle, TXT_DialogLicenseList, TXT_DialogButtonBuy, TXT_DialogButtonCancel); // Let the player buy a license
		{
		    //SFPD
		    if(pickupid == SFPD)
		    {
            ShowPlayerDialog(playerid, DIALOG_SFPD, DIALOG_STYLE_MSGBOX, "SFPD","Are you sure you want to reset wanted level and pay $5.000 for it?", "Accept", "Cancel");
		    }
			//LSPD
		    if(pickupid == LSPD)
	        {
            ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_MSGBOX, "LSPD","Are you sure you want to reset wanted level and pay $5.000 for it?", "Accept", "Cancel");
	        }
			//LVPD
		    if(pickupid == LVPD)
	        {
            ShowPlayerDialog(playerid, DIALOG_LVPD, DIALOG_STYLE_MSGBOX, "LVPD","Are you sure you want to reset wanted level and pay $5.000 for it?", "Accept", "Cancel");
	        }
        }
 	}
 	return 1;
}
(on line 5 ) : warning 206: redundant test: constant expression is non-zero

Код:
case ClassBusDriver:
				{
					// Check if the player is the driver of a vehicle
					if (GetPlayerVehicleSeat(playerid) == 0)
						if (GetVehicleModel(GetPlayerVehicleID(playerid)) == VehicleCoach, VehicleBus) // Check if the player is inside a valid busdriver vehicle
							if (APlayerData[playerid][BusLicense] == 1) // Check if the player has acquired a busdriver license
								ShowPlayerDialog(playerid, DialogBusJobMethod, DIALOG_STYLE_LIST, "Select method:", "Choose your own busroute\r\nAuto assigned busroute", "Select", "Cancel");
							else
								BusDriver_StartJob(playerid, random(sizeof(ABusRoutes))); // Start a random job
						else
			                SendClientMessage(playerid, 0xFF0000FF, "You need to be the driver of a bus to start a job");
					else
		                SendClientMessage(playerid, 0xFF0000FF, "You need to be the driver of a bus to start a job");
				}
Much thanks in advance!
Reply
#2

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    {
    // If the player picks up the Buy_License pickup at the driving school in Doherty
    if (pickupid == Pickup_License)
    // Ask the player which license he wants to buy
    ShowPlayerDialog(playerid, DialogBuyLicenses, DIALOG_STYLE_LIST, TXT_DialogLicenseTitle, TXT_DialogLicenseList, TXT_DialogButtonBuy, TXT_DialogButtonCancel); // Let the player buy a license
    {
    //SFPD
    if(pickupid == SFPD)
    {
    ShowPlayerDialog(playerid, DIALOG_SFPD, DIALOG_STYLE_MSGBOX, "SFPD","Are you sure you want to reset wanted level and pay $5.000 for it?", "Accept", "Cancel");
    }
                //LSPD
    if(pickupid == LSPD)
    {
    ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_MSGBOX, "LSPD","Are you sure you want to reset wanted level and pay $5.000 for it?", "Accept", "Cancel");
    }
                //LVPD
    if(pickupid == LVPD)
    {
    ShowPlayerDialog(playerid, DIALOG_LVPD, DIALOG_STYLE_MSGBOX, "LVPD","Are you sure you want to reset wanted level and pay $5.000 for it?", "Accept", "Cancel");
    }
    }
    }
    return 1;
}
On the second error, which line gives you that error?(comment beside it.)
Reply
#3

GetVehicleModel(GetPlayerVehicleID(playerid)) == VehicleCoach || GetVehicleModel(GetPlayerVehicleID(playerid)) == VehicleBus
Reply
#4

Thanks both, issues fixed!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)