else if inside of Case -
DJ_Shocker - 17.01.2017
Trying to get it to check if a player is near a certain point, starting to wonder if this is even possible inside a case. Getting different errors. I know I'm missing something simple.
Код:
case 4:
{
if(IsPlayerInRangeOfPoint(playerid,7.0,375.3244,-119.4953,1001.4995))//Pizza Stack
{
format(string, sizeof(string), "Breakfast Pizza - %s\nCheese Pizza - %s\nPepperoni Pizza - %s\nHawaiian Pizza - %s\nVeggie Pizza - %s\nLotta-Meat Pizza - %s\nBuffalo Wings - %s\nSide Salad -%s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9])
}
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
else if(IsPlayerInRangeOfPoint(playerid,7.0,376.3320,-67.8667,1001.5151))//Burger Shot
{
format(string,sizeof(string), "Boring Burger - %s\nBoring Cheeseburger - %s\nBacon Cheeseburger - %s\nBacon ChzBurger Dlx. - %s\nBBQ Burger - %s\nFry Fries - %s\nCheesefries - %s\nChiliChz CurlyQs - %s\nSoda - %s\n Water - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9])
}
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
else if(IsPlayerInRangeOfPoint(playerid,7.0,369.5726,-6.0228,1001.8589))//Cluckin Bell
{
format(string,sizeof(string), "Crispy Chicken - %s\nDeep Fried Chicken - %s\nChicken Tenders - %s\nChicken Nuggets - %s\nMashed Tators/Gravy - %s\nMac & Cheese - %s\nCole Slaw - %s\nPeach Cobbler - %s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9])
}
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
else if(IsPlayerInRangeOfPoint(playerid,7.0,379.0815,-187.9003,1000.6328))//Donut Shop
{
format(string, sizeof(string), "Plain Donut - %s\nGlazed Donut - %s\nPowdered Donut - %s\nJelly Filled Donut - %s\nSprinkled Donut - %s\nChocolate Covered - %s\nApple Fritter - %s\nCoffe - %s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9])
};
/*format(string, sizeof(string), "Water - %s\nSoda - %s\nFrench Fries - %s\nCheeseburger - %s\nChicken Burger - %s\nChicken Nuggets - %s\nSalad - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6])
);*/
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
}
case 7:
{
Re: else if inside of Case -
Alvitr - 17.01.2017
im not sure but,
you can try put this
PHP код:
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
in to your if like
PHP код:
if(IsPlayerInRangeOfPoint(playerid,7.0,375.3244,-119.4953,1001.4995))//Pizza Stack
{
format(string, sizeof(string), "Breakfast Pizza - %s\nCheese Pizza - %s\nPepperoni Pizza - %s\nHawaiian Pizza - %s\nVeggie Pizza - %s\nLotta-Meat Pizza - %s\nBuffalo Wings - %s\nSide Salad -%s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9]);
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
}
else if(IsPlayerInRangeOfPoint(playerid,7.0,376.3320,-67.8667,1001.5151))//Burger Shot
{
format(string,sizeof(string), "Boring Burger - %s\nBoring Cheeseburger - %s\nBacon Cheeseburger - %s\nBacon ChzBurger Dlx. - %s\nBBQ Burger - %s\nFry Fries - %s\nCheesefries - %s\nChiliChz CurlyQs - %s\nSoda - %s\n Water - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9]);
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
}
.
.
.
Re: else if inside of Case -
DJ_Shocker - 17.01.2017
I did try that:
Код:
case 4:
{
if(IsPlayerInRangeOfPoint(playerid,7.0,375.3244,-119.4953,1001.4995))//Pizza Stack
{
format(string, sizeof(string), "Breakfast Pizza - %s\nCheese Pizza - %s\nPepperoni Pizza - %s\nHawaiian Pizza - %s\nVeggie Pizza - %s\nLotta-Meat Pizza - %s\nBuffalo Wings - %s\nSide Salad -%s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9])
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
}
else if(IsPlayerInRangeOfPoint(playerid,7.0,376.3320,-67.8667,1001.5151))//Burger Shot
{
format(string,sizeof(string), "Boring Burger - %s\nBoring Cheeseburger - %s\nBacon Cheeseburger - %s\nBacon ChzBurger Dlx. - %s\nBBQ Burger - %s\nFry Fries - %s\nCheesefries - %s\nChiliChz CurlyQs - %s\nSoda - %s\n Water - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9])
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
}
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
else if(IsPlayerInRangeOfPoint(playerid,7.0,369.5726,-6.0228,1001.8589))//Cluckin Bell
{
format(string,sizeof(string), "Crispy Chicken - %s\nDeep Fried Chicken - %s\nChicken Tenders - %s\nChicken Nuggets - %s\nMashed Tators/Gravy - %s\nMac & Cheese - %s\nCole Slaw - %s\nPeach Cobbler - %s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9])
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
}
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
else if(IsPlayerInRangeOfPoint(playerid,7.0,379.0815,-187.9003,1000.6328))//Donut Shop
{
format(string, sizeof(string), "Plain Donut - %s\nGlazed Donut - %s\nPowdered Donut - %s\nJelly Filled Donut - %s\nSprinkled Donut - %s\nChocolate Covered - %s\nApple Fritter - %s\nCoffe - %s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9])
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
};
}
case 7:
{
(10504 -- 10515) : error 001: expected token: ",", but found "-identifier-"
(10519 -- 10530) : error 001: expected token: ",", but found "-identifier-"
(10533) : error 029: invalid expression, assumed zero
(10533) : warning 215: expression has no effect
(10533) : error 001: expected token: ";", but found "if"
C:\Users\Administrator\Desktop\SU-Gaming\samp037_svr_R2-1-1_win32\gamemodes\roleplayRestaurantMenus.pwn(1053 5 -- 10546) : error 001: expected token: ",", but found "-identifier-"
(10549) : error 029: invalid expression, assumed zero
(10549) : warning 215: expression has no effect
(10549) : error 001: expected token: ";", but found "if"
(10551 -- 10562) : error 001: expected token: ",", but found "-identifier-"
(10563) : error 036: empty statement
Now you see why I'm confused
Re: else if inside of Case -
X337 - 17.01.2017
The errors because of your format() code.
Код:
case 4:
{
if(IsPlayerInRangeOfPoint(playerid,7.0,375.3244,-119.4953,1001.4995))//Pizza Stack
{
format(string, sizeof(string), "Breakfast Pizza - %s\nCheese Pizza - %s\nPepperoni Pizza - %s\nHawaiian Pizza - %s\nVeggie Pizza - %s\nLotta-Meat Pizza - %s\nBuffalo Wings - %s\nSide Salad -%s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9]));
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
}
else if(IsPlayerInRangeOfPoint(playerid,7.0,376.3320,-67.8667,1001.5151))//Burger Shot
{
format(string,sizeof(string), "Boring Burger - %s\nBoring Cheeseburger - %s\nBacon Cheeseburger - %s\nBacon ChzBurger Dlx. - %s\nBBQ Burger - %s\nFry Fries - %s\nCheesefries - %s\nChiliChz CurlyQs - %s\nSoda - %s\n Water - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9]));
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
}
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
else if(IsPlayerInRangeOfPoint(playerid,7.0,369.5726,-6.0228,1001.8589))//Cluckin Bell
{
format(string,sizeof(string), "Crispy Chicken - %s\nDeep Fried Chicken - %s\nChicken Tenders - %s\nChicken Nuggets - %s\nMashed Tators/Gravy - %s\nMac & Cheese - %s\nCole Slaw - %s\nPeach Cobbler - %s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9]));
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
}
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
else if(IsPlayerInRangeOfPoint(playerid,7.0,379.0815,-187.9003,1000.6328))//Donut Shop
{
format(string, sizeof(string), "Plain Donut - %s\nGlazed Donut - %s\nPowdered Donut - %s\nJelly Filled Donut - %s\nSprinkled Donut - %s\nChocolate Covered - %s\nApple Fritter - %s\nCoffe - %s\nSoda - %s\nWater - %s",
FormatNumber(BusinessData[bizid][bizPrices][0]),
FormatNumber(BusinessData[bizid][bizPrices][1]),
FormatNumber(BusinessData[bizid][bizPrices][2]),
FormatNumber(BusinessData[bizid][bizPrices][3]),
FormatNumber(BusinessData[bizid][bizPrices][4]),
FormatNumber(BusinessData[bizid][bizPrices][5]),
FormatNumber(BusinessData[bizid][bizPrices][6]),
FormatNumber(BusinessData[bizid][bizPrices][7]),
FormatNumber(BusinessData[bizid][bizPrices][8]),
FormatNumber(BusinessData[bizid][bizPrices][9]));
Dialog_Show(playerid, BusinessBuy, DIALOG_STYLE_LIST, BusinessData[bizid][bizName], string, "Purchase", "Cancel");
};
}
case 7:
{
Re: else if inside of Case -
DJ_Shocker - 17.01.2017
omg X337 Thanks, if this seems noob, I'm sorry, I'm still learning some things, but why would that extra be needed?
Thanks and +Rep