24.12.2013, 11:40
Except that opposite bracket, you need to use brackets in case as well.
Plus the dialog was in the last case instead of out of the switch.
pawn Код:
case ClassPilot: // 1 statement
pawn Код:
case ClassPilot:
{
// more statements..
}
pawn Код:
switch (APlayerData[playerid][PlayerClass])
{
case ClassTruckDriver:
{
if(APlayerData[playerid][House] != 0)
{
HouseID = APlayerData[playerid][House];
x = AHouseData[HouseID][HouseX];
y = AHouseData[HouseID][HouseY];
z = AHouseData[HouseID][HouseZ];
format(Msg1,256,"%s%s\r\n%s%s\r\n%s%s",GetArea(-525.0, -502.0, 26.0),GetMainZone(-525.0, -502.0, 26.0),GetArea(-77.3318, -1136.0590, 1.0781),GetMainZone(-77.3318, -1136.0590, 1.0781),GetArea(1470.8528, 1025.5811, 10.8203),GetMainZone(1470.8528, 1025.5811, 10.8203));
format(Msg2,256,"%s%s\r\n%s%s\r\n%s%s",GetArea(-2136.0, -247.5, 36.5),GetMainZone(-2136.0, -247.5, 36.5),GetArea(1766.5, -2040.7, 14.0),GetMainZone(1766.5, -2040.7, 14.0),GetArea(-546.0, 2594.0, 54.0),GetMainZone(-546.0, 2594.0, 54.0));
format(Msg3,256,"%s%s\r\n%s%s\r\nHouse(ID%i) at %s%s",GetArea(332.0, 900.0, 25.0),GetMainZone(332.0, 900.0, 25.0),GetArea(-1575.0, -2724.0, 49.0),GetMainZone(-1575.0, -2724.0, 49.0),HouseID,GetArea(x,y,z),GetMainZone(x,y,z));
format(DialogMsg5000,5000,"%s\r\n%s\r\n%s",Msg1,Msg2,Msg3);
}
else
{
format(Msg1,256,"%s%s\r\n%s%s\r\n%s%s",GetArea(-525.0, -502.0, 26.0),GetMainZone(-525.0, -502.0, 26.0),GetArea(-77.3318, -1136.0590, 1.0781),GetMainZone(-77.3318, -1136.0590, 1.0781),GetArea(1470.8528, 1025.5811, 10.8203),GetMainZone(1470.8528, 1025.5811, 10.8203));
format(Msg2,256,"%s%s\r\n%s%s\r\n%s%s",GetArea(-2136.0, -247.5, 36.5),GetMainZone(-2136.0, -247.5, 36.5),GetArea(1766.5, -2040.7, 14.0),GetMainZone(1766.5, -2040.7, 14.0),GetArea(-546.0, 2594.0, 54.0),GetMainZone(-546.0, 2594.0, 54.0));
format(Msg3,256,"%s%s\r\n%s%s",GetArea(332.0, 900.0, 25.0),GetMainZone(332.0, 900.0, 25.0),GetArea(-1575.0, -2724.0, 49.0),GetMainZone(-1575.0, -2724.0, 49.0));
format(DialogMsg5000,5000,"%s\r\n%s\r\n%s",Msg1,Msg2,Msg3);
}
}
case ClassBusDriver:
{
if(APlayerData[playerid][House] != 0)
{
HouseID = APlayerData[playerid][House];
x = AHouseData[HouseID][HouseX];
y = AHouseData[HouseID][HouseY];
z = AHouseData[HouseID][HouseZ];
format(Msg1,256,"%s%s\r\n%s%s",GetArea(1809.0, -1905.0, 13.6),GetMainZone(1809.0, -1905.0, 13.6),GetArea(-1983.0, 110.0, 27.7),GetMainZone(-1983.0, 110.0, 27.7));
format(Msg2,256,"%s%s\r\nHouse(ID%i) at %s%s",GetArea(1060.0, 1260.0, 11.0),GetMainZone(1060.0, 1260.0, 11.0),HouseID,GetArea(x,y,z),GetMainZone(x,y,z));
format(DialogMsg5000,5000,"%s\r\n%s",Msg1,Msg2);
}
else
{
format(Msg1,256,"%s%s\r\n%s%s",GetArea(1809.0, -1905.0, 13.6),GetMainZone(1809.0, -1905.0, 13.6),GetArea(-1983.0, 110.0, 27.7),GetMainZone(-1983.0, 110.0, 27.7));
format(Msg2,256,"%s%s",GetArea(1060.0, 1260.0, 11.0),GetMainZone(1060.0, 1260.0, 11.0));
format(DialogMsg5000,5000,"%s\r\n%s",Msg1,Msg2);
}
}
case ClassPilot:
{
if(APlayerData[playerid][House] != 0)
{
HouseID = APlayerData[playerid][House];
x = AHouseData[HouseID][HouseX];
y = AHouseData[HouseID][HouseY];
z = AHouseData[HouseID][HouseZ];
format(Msg1,256,"%s%s\r\n%s%s",GetArea(2010.0, -2345.0, 13.6),GetMainZone(2010.0, -2345.0, 13.6),GetArea(-1211.0, -105.0, 14.2),GetMainZone(-1211.0, -105.0, 14.2));
format(Msg2,256,"%s%s\r\nHouse(ID%i) at %s%s",GetArea(1630.0, 1615.0, 10.9),GetMainZone(1630.0, 1615.0, 10.9),HouseID,GetArea(x,y,z),GetMainZone(x,y,z));
format(DialogMsg5000,5000,"%s\r\n%s",Msg1,Msg2);
}
else
{
format(Msg1,256,"%s%s\r\n%s%s",GetArea(2010.0, -2345.0, 13.6),GetMainZone(2010.0, -2345.0, 13.6),GetArea(-1211.0, -105.0, 14.2),GetMainZone(-1211.0, -105.0, 14.2));
format(Msg2,256,"%s%s",GetArea(1630.0, 1615.0, 10.9),GetMainZone(1630.0, 1615.0, 10.9));
format(DialogMsg5000,5000,"%s\r\n%s",Msg1,Msg2);
}
}
case ClassPolice:
{
if(APlayerData[playerid][House] != 0)
{
HouseID = APlayerData[playerid][House];
x = AHouseData[HouseID][HouseX];
y = AHouseData[HouseID][HouseY];
z = AHouseData[HouseID][HouseZ];
format(Msg1,256,"%s%s\r\n%s%s",GetArea(1568.5, -1693.5, 6.0),GetMainZone(1568.5, -1693.5, 6.0),GetArea(-1590.0, 716.25, -5.0),GetMainZone(-1590.0, 716.25, -5.0));
format(Msg2,256,"%s%s\r\nHouse(ID%i) at %s%s",GetArea(2275.0, 2460.0, 10.9),GetMainZone(2275.0, 2460.0, 10.9),HouseID,GetArea(x,y,z),GetMainZone(x,y,z));
format(DialogMsg5000,5000,"%s\r\n%s",Msg1,Msg2);
}
else
{
format(Msg1,256,"%s%s\r\n%s%s",GetArea(1568.5, -1693.5, 6.0),GetMainZone(1568.5, -1693.5, 6.0),GetArea(-1590.0, 716.25, -5.0),GetMainZone(-1590.0, 716.25, -5.0));
format(Msg2,256,"%s%s",GetArea(2275.0, 2460.0, 10.9),GetMainZone(2275.0, 2460.0, 10.9));
format(DialogMsg5000,5000,"%s\r\n%s",Msg1,Msg2);
}
}
case ClassCourier:
{
if(APlayerData[playerid][House] != 0)
{
HouseID = APlayerData[playerid][House];
x = AHouseData[HouseID][HouseX];
y = AHouseData[HouseID][HouseY];
z = AHouseData[HouseID][HouseZ];
format(Msg1,256,"%s%s\r\n%s%s",GetArea(798.0, -618.75, 16.4),GetMainZone(798.0, -618.75, 16.4),GetArea(-1849.25, -135.0, 12.0),GetMainZone(-1849.25, -135.0, 12.0));
format(Msg2,256,"%s%s\r\nHouse(ID%i) at %s%s",GetArea(1050.5, 1931.0, 10.9),GetMainZone(1050.5, 1931.0, 10.9),HouseID,GetArea(x,y,z),GetMainZone(x,y,z));
format(DialogMsg5000,5000,"%s\r\n%s",Msg1,Msg2);
}
else
{
format(Msg1,256,"%s%s\r\n%s%s",GetArea(798.0, -618.75, 16.4),GetMainZone(798.0, -618.75, 16.4),GetArea(-1849.25, -135.0, 12.0),GetMainZone(-1849.25, -135.0, 12.0));
format(Msg2,256,"%s%s",GetArea(1050.5, 1931.0, 10.9),GetMainZone(1050.5, 1931.0, 10.9));
format(DialogMsg5000,5000,"%s\r\n%s",Msg1,Msg2);
}
}
case ClassTraindriver:
{
if(APlayerData[playerid][House] != 0)
{
HouseID = APlayerData[playerid][House];
x = AHouseData[HouseID][HouseX];
y = AHouseData[HouseID][HouseY];
z = AHouseData[HouseID][HouseZ];
format(Msg1,256,"%s%s\r\n%s%s",GetArea(1751.30, -1945.32, 13.56),GetMainZone(1751.30, -1945.32, 13.56),GetArea(825.9033, -1356.9008, -0.5078),GetMainZone(825.9033, -1356.9008, -0.5078));
format(Msg2,256,"%s%s\r\n%s%s",GetArea(-1969.34, 137.86, 27.68),GetMainZone(-1969.34, 137.86, 27.68),GetArea(2850.3848, 1290.6886, 11.3906),GetMainZone(2850.3848, 1290.6886, 11.3906));
format(Msg3,256,"%s%s\r\nHouse(ID%i) at %s%s",GetArea(1433.5442, 2620.3999, 11.3926),GetMainZone(1433.5442, 2620.3999, 11.3926),HouseID,GetArea(x,y,z),GetMainZone(x,y,z));
format(DialogMsg5000,5000,"%s\r\n%s\r\n%s",Msg1,Msg2,Msg3);
}
else
{
format(Msg1,256,"%s%s\r\n%s%s",GetArea(1751.30, -1945.32, 13.56),GetMainZone(1751.30, -1945.32, 13.56),GetArea(825.9033, -1356.9008, -0.5078),GetMainZone(825.9033, -1356.9008, -0.5078));
format(Msg2,256,"%s%s\r\n%s%s",GetArea(-1969.34, 137.86, 27.68),GetMainZone(-1969.34, 137.86, 27.68),GetArea(2850.3848, 1290.6886, 11.3906),GetMainZone(2850.3848, 1290.6886, 11.3906));
format(Msg3,256,"%s%s",GetArea(1433.5442, 2620.3999, 11.3926),GetMainZone(1433.5442, 2620.3999, 11.3926));
format(DialogMsg5000,5000,"%s\r\n%s\r\n%s",Msg1,Msg2,Msg3);
}
}
}
ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Choose spawn point:", DialogMsg5000, "Spawn", "Cancel");