[Ajuda] only a single statement (or expression) can follow each "case"
#1

o unico que й dado й nele й esse do titulo (Nao achei no search)
Erro:
Код:
C:\Users\Ailton\Downloads\samp037_svr_R2-1-1_win32 (1)\gamemodes\megax.pwn(228) : error 002: only a single statement (or expression) can follow each "case"
GM:
Код:
#include <a_samp>
#include <DOF2>
#include <zcmd>
#include <SII>
#include <string>
#include <a_vehicles>
#include <a_players>
//
#define TEAM_Caminhoneiro 1
#define TEAM_Lixeiro 2
#define DIALOG_REGISTRO 2000
#define DIALOG_LOGAR 2001
#define BRANCO "{FFFFFF}"
#define VERMELHO "{F81414}"
#define VERDE "{00FF22}"
#define AZUL CLARO "{00CED1}"
#define COLOR_RED 0xFF0000AA
//
enum TeamCars
{
Caminhoneiro,
Lixeiro
}
enum pInfo
{
    pSenha,
    pScore,
    pDinheiro,
    pAdmin,
}
new Menu:Trabalhos;
new gTeam[MAX_PLAYERS];
new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
new Cars[TeamCars];
new PlayerInfo[MAX_PLAYERS][pInfo];

D:trabalhos(playerid, params []) // Primeira linha do Comando, Em "Comando" coloque o nome do seu comando, Mas sem o barra ("/")
{ // Abrimos uma chave - a Principal do comando
// Aqui colocamos a funзгo do comando por exemplo:
ShowMenuForPlayer(Trabalhos, playerid);
    return 1; // Fechamos o comando
} // Utima chave do comando

public OnGameModeInit()
{

Trabalhos = CreateMenu("Trabalhos", 1, 50.0, 180.0, 200.0, 200.0);
AddMenuItem(Trabalhos, 0, "Caminhoneiro");
AddMenuItem (Trabalhos, 0, "Lixeiro");
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-590.4003900,-473.7002000,25.8000000,177.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-579.5999800,-473.6000100,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-569.0999800,-474.0000000,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-559.5999800,-473.8999900,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-549.5999800,-474.2000100,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-539.5999800,-473.7999900,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-534.4003900,-474.2002000,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-529.9003900,-474.0996100,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-524.5000000,-474.3999900,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-519.2000100,-474.5000000,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-514.2000100,-474.7999900,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-514.2002000,-474.7998000,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-509.2000100,-475.1000100,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-504.2000100,-474.7999900,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-499.3999900,-474.5000000,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-494.8999900,-474.7000100,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-489.6000100,-474.3999900,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(456,-479.5996100,-474.0996100,25.8000000,179.9950000,93,126,15); //Yankee
Cars[Caminhoneiro] = AddStaticVehicleEx(414,-584.7999900,-475.0000000,25.7000000,180.0000000,95,10,15); //Mule
Cars[Caminhoneiro] = AddStaticVehicleEx(414,-574.7999900,-475.1000100,25.5000000,180.0000000,95,10,15); //Mule
Cars[Caminhoneiro] = AddStaticVehicleEx(414,-565.2000100,-474.5000000,25.7000000,180.0000000,95,10,15); //Mule
Cars[Caminhoneiro] = AddStaticVehicleEx(414,-555.0000000,-474.3999900,25.7000000,180.0000000,95,10,15); //Mule
Cars[Caminhoneiro] = AddStaticVehicleEx(414,-544.7999900,-474.2999900,25.7000000,180.0000000,95,10,15); //Mule
Cars[Caminhoneiro] = AddStaticVehicleEx(414,-484.2999900,-474.3999900,25.8000000,179.9950000,93,126,15); //Mule
AddStaticVehicleEx(408,-193.5000000,-1120.5000000,4.6000000,238.0000000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-195.6000100,-1124.6000000,4.6000000,237.9970000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-198.8999900,-1129.0000000,4.6000000,237.9970000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-201.6000100,-1133.9000000,4.6000000,237.9970000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-205.3000000,-1138.7000000,4.6000000,237.9970000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-129.6000100,-1171.0000000,3.9000000,70.0000000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-128.3999900,-1166.4000000,3.9000000,69.9940000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-126.8000000,-1161.4000000,3.9000000,69.9940000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-125.2000000,-1155.1000000,3.9000000,69.9940000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-125.3000000,-1149.4000000,3.3000000,71.9940000,165,169,15); //Trashmaster
AddStaticVehicleEx(408,-122.9000000,-1144.7000000,2.9000000,69.9940000,165,169,15); //Trashmaster
AddStaticVehicleEx(487, 103.2447, -77.8093, 2.1518, 0.0000, -1, -1, 100);
AddStaticVehicleEx (522,10.9000000,15.5000000,2.8000000,0.0000000,132,4,15); //NRG-500
CreateObject(3359,-618.4000200,-504.6000100,24.5000000,0.0000000,0.0000000,90.0000000); //object(cxrf_savhusgar1_) (1)
CreateObject(11631,-622.0000000,-501.8999900,25.8000000,0.0000000,0.0000000,90.0000000); //object(ranch_desk) (1)
CreateObject(1671,-621.2000100,-501.5000000,25.0000000,0.0000000,0.0000000,270.0000000); //object(swivelchair_a) (1)
CreateObject(2165,-617.2000100,-507.7000100,24.5000000,0.0000000,0.0000000,0.0000000); //object(med_office_desk_1) (1)
CreateObject(1671,-616.5000000,-508.7999900,25.0000000,0.0000000,2.0000000,182.0000000); //object(swivelchair_a) (2)
CreateObject(1708,-617.7999900,-506.0000000,24.5000000,0.0000000,358.0000000,28.0000000); //object(kb_chair02) (1)
CreateObject(1817,-617.7000100,-500.2000100,24.5000000,0.0000000,0.0000000,0.0000000); //object(coffee_med_2) (1)
CreateObject(9125,-611.7999900,-511.2999900,24.8000000,0.0000000,0.0000000,0.0000000); //object(lxorneon) (1)
CreateObject(4028,-570.2999900,-545.2999900,38.0000000,0.0000000,0.0000000,0.0000000); //object(lanstap) (1)
CreateObject(6356,-569.5000000,-506.6000100,34.8000000,0.0000000,0.0000000,0.0000000); //object(sunset06_law2) (1)
CreateObject(6356,-539.0000000,-507.3999900,34.6000000,0.0000000,0.0000000,0.0000000); //object(sunset06_law2) (2)
CreateObject(6356,-528.7999900,-507.7999900,34.6000000,0.0000000,0.0000000,0.0000000); //object(sunset06_law2) (3)
CreateObject(6387,-493.2000100,-529.5999800,28.3000000,0.0000000,0.0000000,0.0000000); //object(century03_law2) (1)
CreateObject(10773,-614.2999900,-483.7000100,27.3000000,0.0000000,0.0000000,90.0000000); //object(dk_cargoshp2_sfse) (1)
CreateObject(17302,-160.8281200,-1100.7656000,6.4296900,0.0000000,0.0000000,0.0000000); //object(cuntwland51b) (1)
CreateObject(987,-115.1000000,-1146.3000000,0.5000000,358.0000000,0.0000000,68.0000000); //object(elecfence_bar) (1)
CreateObject(987,-119.6000000,-1157.4000000,0.5000000,357.9950000,0.0000000,68.0000000); //object(elecfence_bar) (2)
CreateObject(987,-124.1000000,-1168.3000000,1.5000000,357.9950000,0.0000000,68.0000000); //object(elecfence_bar) (3)
CreateObject(987,-128.6000100,-1179.2000000,1.5000000,357.9950000,0.0000000,68.0000000); //object(elecfence_bar) (4)
CreateObject(987,-132.8999900,-1190.2000000,1.5000000,357.9950000,0.0000000,68.0000000); //object(elecfence_bar) (5)
CreateObject(987,-137.3000000,-1201.4000000,1.5000000,357.9950000,0.0000000,68.0000000); //object(elecfence_bar) (6)
CreateObject(987,-141.7000000,-1212.1000000,1.5000000,357.9950000,0.0000000,68.0000000); //object(elecfence_bar) (7)
CreateObject(987,-146.1000100,-1223.2000000,1.5000000,357.9950000,0.0000000,68.0000000); //object(elecfence_bar) (8)
CreateObject(987,-102.0000000,-1117.3000000,0.5000000,358.0060000,353.9960000,169.7900000); //object(elecfence_bar) (9)
CreateObject(987,-113.6000000,-1115.2000000,1.8000000,357.9940000,355.9970000,169.8580000); //object(elecfence_bar) (11)
CreateObject(987,-124.9000000,-1113.3000000,2.5000000,357.9860000,357.9970000,167.9240000); //object(elecfence_bar) (12)
CreateObject(987,-136.3999900,-1110.7000000,2.5000000,357.9840000,357.9950000,171.9210000); //object(elecfence_bar) (13)
CreateObject(987,-148.2000000,-1108.9000000,2.5000000,357.9790000,357.9900000,191.9200000); //object(elecfence_bar) (14)
CreateObject(987,-159.3999900,-1111.3000000,2.5000000,357.9790000,357.9840000,193.9150000); //object(elecfence_bar) (15)
CreateObject(987,-170.3999900,-1114.1000000,2.5000000,357.9790000,357.9790000,171.9130000); //object(elecfence_bar) (16)
CreateObject(987,-181.6000100,-1112.7000000,2.5000000,357.9790000,357.9790000,159.9090000); //object(elecfence_bar) (17)
CreateObject(987,-193.0000000,-1108.4000000,2.5000000,357.9790000,357.9790000,235.9060000); //object(elecfence_bar) (18)
CreateObject(987,-199.3999900,-1118.1000000,2.5000000,357.9790000,357.9790000,237.9040000); //object(elecfence_bar) (19)
CreateObject(987,-205.8000000,-1128.2000000,2.5000000,357.9790000,357.9790000,237.9030000); //object(elecfence_bar) (20)
CreateObject(987,-211.8999900,-1138.2000000,3.0000000,357.9790000,357.9790000,237.9040000); //object(elecfence_bar) (21)
CreateObject(987,-217.7000000,-1147.5000000,3.3000000,357.9790000,357.9790000,233.9040000); //object(elecfence_bar) (22)
CreateObject(987,-150.7000000,-1234.3000000,1.5000000,357.9950000,0.0000000,68.0000000); //object(elecfence_bar) (23)
CreateObject(987,-224.7000000,-1157.2000000,3.8000000,357.9790000,357.9790000,233.8990000); //object(elecfence_bar) (24)
CreateObject(987,-231.6000100,-1166.7000000,4.0000000,357.9880000,353.9760000,233.7580000); //object(elecfence_bar) (25)
CreateObject(987,-237.7000000,-1175.4000000,5.3000000,357.9840000,353.9740000,227.7560000); //object(elecfence_bar) (26)
CreateObject(987,-245.5000000,-1184.0000000,6.1000000,357.9670000,359.9720000,265.9650000); //object(elecfence_bar) (27)
CreateObject(987,-246.5000000,-1196.1000000,5.8000000,357.9690000,357.9710000,291.8900000); //object(elecfence_bar) (28)
CreateObject(987,-242.1000100,-1207.1000000,5.8000000,357.9680000,357.9680000,321.8900000); //object(elecfence_bar) (29)
CreateObject(987,-232.6000100,-1214.5000000,5.8000000,357.9620000,357.9620000,351.8880000); //object(elecfence_bar) (30)
CreateObject(987,-220.8999900,-1216.4000000,6.8000000,357.9810000,351.9580000,345.6740000); //object(elecfence_bar) (31)
CreateObject(987,-210.1000100,-1219.5000000,8.3000000,357.9640000,355.9600000,353.8140000); //object(elecfence_bar) (32)
CreateObject(987,-198.3999900,-1221.0000000,8.3000000,357.9580000,357.9580000,343.8800000); //object(elecfence_bar) (33)
CreateObject(987,-187.6000100,-1224.2000000,8.1000000,357.9660000,5.9620000,336.1630000); //object(elecfence_bar) (34)
CreateObject(987,-176.7000000,-1229.2000000,7.1000000,357.9820000,9.9620000,348.3010000); //object(elecfence_bar) (35)
CreateObject(987,-164.8000000,-1231.8000000,5.1000000,357.9790000,9.9590000,348.3000000); //object(elecfence_bar) (37)
CreateObject(987,-162.8000000,-1232.3000000,5.1000000,357.9790000,9.9590000,348.3000000); //object(elecfence_bar) (38)
CreateObject(987,-151.0000000,-1235.0000000,1.5000000,357.9950000,0.0000000,68.0000000); //object(elecfence_bar) (39)
CreateObject(987,-112.1000000,-1139.7000000,0.5000000,357.9950000,0.0000000,60.0000000); //object(elecfence_bar) (40)
CreateObject(16088,-102.9000000,-1123.8000000,0.9000000,0.0000000,0.0000000,338.0000000); //object(des_pipestrut01) (1)
CreateObject(1715,-219.8000000,-1206.7000000,8.3000000,0.0000000,0.0000000,62.0000000); //object(kb_swivelchair2) (1)
CreateObject(1806,-217.5000000,-1207.5000000,8.2000000,0.0000000,0.0000000,90.0000000); //object(med_office_chair) (1)
CreateObject(1806,-218.1000100,-1208.5000000,8.2000000,0.0000000,0.0000000,44.0000000); //object(med_office_chair) (2)
CreateObject(18267,-215.1000100,-1209.9000000,7.9000000,0.0000000,0.0000000,62.0000000); //object(logcabinn) (1)
CreateObject(1963,-218.6000100,-1207.3000000,8.6000000,0.0000000,0.0000000,66.0000000); //object(est_desk) (1)
CreateObject(1723,-209.0000000,-1209.9000000,8.0000000,0.0000000,0.0000000,242.0000000); //object(mrk_seating1) (1)
CreateObject(1723,-210.8000000,-1213.6000000,8.0000000,0.0000000,0.0000000,241.9960000); //object(mrk_seating1) (2)
CreateObject(1422,-222.8000000,-1200.7000000,7.2000000,0.0000000,0.0000000,330.0000000); //object(dyn_roadbarrier_5) (1)
CreateObject(1422,-223.8000000,-1200.2000000,7.2000000,0.0000000,0.0000000,329.9960000); //object(dyn_roadbarrier_5) (2)
CreateObject(1422,-229.1000100,-1207.4000000,7.2000000,0.0000000,0.0000000,329.9960000); //object(dyn_roadbarrier_5) (3)
CreateObject(1422,-227.0000000,-1208.8000000,7.2000000,0.0000000,0.0000000,329.9960000); //object(dyn_roadbarrier_5) (4)
CreateObject(8879,-208.5000000,-1148.9000000,10.3000000,0.0000000,0.0000000,262.0000000); //object(vgsecnstrct08) (1)
CreateObject(8879,-142.1000100,-1184.7000000,8.6000000,0.0000000,0.0000000,31.9960000); //object(vgsecnstrct08) (2)
CreateObject(3722,-150.2000000,-1216.9000000,7.1000000,0.0000000,0.0000000,338.0000000); //object(laxrf_scrapbox) (1)
CreateObject(16071,-171.3999900,-1205.9000000,9.8000000,0.0000000,0.0000000,188.0000000); //object(des_quarrybelt02) (1)
CreateObject(920,-174.8999900,-1204.6000000,10.0000000,0.0000000,348.0000000,338.0000000); //object(y_generator) (1)
CreateObject(920,-175.8999900,-1203.9000000,9.8000000,0.0000000,347.9970000,338.0000000); //object(y_generator) (2)
CreateObject(920,-176.1000100,-1204.3000000,9.8000000,0.0000000,347.9970000,338.0000000); //object(y_generator) (3)
CreateObject(16304,-213.5000000,-1167.1000000,12.0000000,0.0000000,0.0000000,0.0000000); //object(des_gravelpile05) (1)
}

public OnPlayerStateChange (playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[Caminhoneiro] )
        {
            if(gTeam[playerid] != 1)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "Voce nao й caminhoneiro para usar este veiculo!");
                return 1;
            }
        }
        return 1;
    }
    return 1;
}
public OnPlayerConnect(playerid)
{
RemoveBuildingForPlayer(playerid, 17012, -542.00781, -522.84375, 29.59375, 47.142307); // removeWorldObject (cwsthseing26) (1)
RemoveBuildingForPlayer(playerid, 17349, -542.00781, -522.84375, 29.59375, 47.142307); // (LOD) removeWorldObject (cwsthseing26) (1)
RemoveBuildingForPlayer(playerid, 17020, -475.97656, -544.85156, 28.11719, 25.477262); // removeWorldObject (cuntfrates02) (1)
RemoveBuildingForPlayer(playerid, 17019, -606.03125, -528.82031, 30.52344, 33.533878); // removeWorldObject (cuntfrates1) (1)
RemoveBuildingForPlayer(playerid, 1440, -553.24762, -481.07794, 25.28182, 3.6364884); // removeWorldObject (DYN_BOX_PILE_3) (1)
RemoveBuildingForPlayer(playerid, 1415, -619.70551, -474.40442, 25.40551, 3.9259243); // removeWorldObject (DYN_DUMPSTER) (1)
RemoveBuildingForPlayer(playerid, 1415, -620.80713, -490.37988, 25.13132, 3.9259243); // removeWorldObject (DYN_DUMPSTER) (2)
RemoveBuildingForPlayer(playerid, 1278, -532.46875, -479.92187, 38.64844, 16.251438); // removeWorldObject (sub_floodlite) (1)
RemoveBuildingForPlayer(playerid, 3276, -153.04483, -1282.252, 2.85985, 8.2899265); // removeWorldObject (cxreffencesld) (1)
RemoveBuildingForPlayer(playerid, 3276, -151.89343, -1271.8245, 2.52448, 8.2899265); // removeWorldObject (cxreffencesld) (2)
RemoveBuildingForPlayer(playerid, 3276, -149.07942, -1254.5345, 3.31965, 8.2899265); // removeWorldObject (cxreffencesld) (3)
RemoveBuildingForPlayer(playerid, 3276, -147.64499, -1246.0563, 2.49325, 8.2899265); // removeWorldObject (cxreffencesld) (4)
RemoveBuildingForPlayer(playerid, 3276, -145.56161, -1237.4752, 3.08967, 8.2899265); // removeWorldObject (cxreffencesld) (5)
RemoveBuildingForPlayer(playerid, 3276, -138.28349, -1207.8568, 2.31136, 8.2899265); // removeWorldObject (cxreffencesld) (6)
RemoveBuildingForPlayer(playerid, 3276, -142.12321, -1220.8267, 3.26719, 8.2899265); // removeWorldObject (cxreffencesld) (7)
RemoveBuildingForPlayer(playerid, 3276, -132.81213, -1191.3632, 3.24548, 8.2899265); // removeWorldObject (cxreffencesld) (8)
RemoveBuildingForPlayer(playerid, 3276, -127.80759, -1178.8331, 3.38325, 8.2899265); // removeWorldObject (cxreffencesld) (9)
RemoveBuildingForPlayer(playerid, 3276, -126.11987, -1165.6118, 2.44504, 8.2899265); // removeWorldObject (cxreffencesld) (10)
RemoveBuildingForPlayer(playerid, 3276, -136.89897, -1161.9977, 3.364, 8.2899265); // removeWorldObject (cxreffencesld) (11)
RemoveBuildingForPlayer(playerid, 3276, -155.8575, -1155.6498, 2.61485, 8.2899265); // removeWorldObject (cxreffencesld) (12)
RemoveBuildingForPlayer(playerid, 3276, -169.08417, -1151.0002, 3.3795, 8.2899265); // removeWorldObject (cxreffencesld) (13)
RemoveBuildingForPlayer(playerid, 3276, -188.06927, -1144.6685, 4.31315, 8.2899265); // removeWorldObject (cxreffencesld) (14)
RemoveBuildingForPlayer(playerid, 3276, -198.74529, -1140.5532, 4.0867, 8.2899265); // removeWorldObject (cxreffencesld) (15)
RemoveBuildingForPlayer(playerid, 790, -270.88281, -1214.6797, 9.67969, 38.562614); // removeWorldObject (sm_fir_tallgroup) (1)
}

 public OnPlayerSelectedMenuRow(playerid,row)
{
new Menu:current;
current=GetPlayerMenu(playerid);
if(current==Trabalhos)
{
switch(row)
{
case 0:{

TogglePlayerControllable(playerid, 1);
SetPlayerTeam(playerid,TEAM_Caminhoneiro);
TogglePlayerControllable(playerid, 1);
}
case 1:{
if(gTeam[playerid]==TEAM_Lixeiro)
TogglePlayerControllable(playerid, 1);
SetPlayerTeam(playerid,TEAM_Lixeiro);
TogglePlayerControllable(playerid, 1);
}
Reply
#2

Quote:
Originally Posted by Cycle
Посмотреть сообщение
Switch, comeзa igual a qualquer valor dentro do pawn. Zero, entгo acredito que seria:
PHP код:
public OnPlayerSelectedMenuRow(playerid,row)
{
new 
Menu:current;
current=GetPlayerMenu(playerid);
if(
current==Trabalhos)
{
switch(
row)
{
case 
0:{
TogglePlayerControllable(playerid1);
SetPlayerTeam(playerid,TEAM_Caminhoneiro);
TogglePlayerControllable(playerid1);
}
case 
1:{
if(
gTeam[playerid]==TEAM_Lixeiro)
TogglePlayerControllable(playerid1);
SetPlayerTeam(playerid,TEAM_Lixeiro);
TogglePlayerControllable(playerid1);

Mano, essa versгo sua removeu umas warnings que estavam dando, jб agradeзo, mas ainda fica no erro do "case"
Reply
#3

Quote:
Originally Posted by Cycle
Посмотреть сообщение
Switch, comeзa igual a qualquer valor dentro do pawn. Zero, entгo acredito que seria:
PHP код:
public OnPlayerSelectedMenuRow(playerid,row)
{
new 
Menu:current;
current=GetPlayerMenu(playerid);
if(
current==Trabalhos)
{
switch(
row)
{
case 
0:{
TogglePlayerControllable(playerid1);
SetPlayerTeam(playerid,TEAM_Caminhoneiro);
TogglePlayerControllable(playerid1);
}
case 
1:{
if(
gTeam[playerid]==TEAM_Lixeiro)
TogglePlayerControllable(playerid1);
SetPlayerTeam(playerid,TEAM_Lixeiro);
TogglePlayerControllable(playerid1);

Switch vocк pode utilizar o valor que quiser o problema nгo й isso, case й nada mais que o valor a ser comparado com o que esta dentro de switch.

@topic
Se vocк reparar no seu cуdigo vai ver que nгo fechou o tanto de chave que abriu "{ }"
Reply
#4

Quote:
Originally Posted by Cycle
Посмотреть сообщение
Qual a linha que aparece o erro?
Tб falando que o erro ta na linha 228, sendo que o gm sу tem 227 linhas.
Reply
#5

Quote:
Originally Posted by Cycle
Посмотреть сообщение
Faltou vocк fechar a chave da verificaзгo da current trabalhos, e a abertura do switch.
Tente assim:
PHP код:
public OnPlayerSelectedMenuRow(playerid,row

new 
Menu:current
current=GetPlayerMenu(playerid); 
if(
current==Trabalhos

switch(
row

case 
0:{ 
TogglePlayerControllable(playerid1); 
SetPlayerTeam(playerid,TEAM_Caminhoneiro); 
TogglePlayerControllable(playerid1); 

case 
1:{ 
if(
gTeam[playerid]==TEAM_Lixeiro
TogglePlayerControllable(playerid1); 
SetPlayerTeam(playerid,TEAM_Lixeiro); 
TogglePlayerControllable(playerid1); 
}  
}

PHP код:
C:\Users\Ailton\Downloads\samp037_svr_R2-1-1_win32 (1)\gamemodes\megax.pwn(230) : error 030compound statement not closed at the end of file (started at line 210
O erro de antes foi apagado , mas este apareceu
Reply
#6

Quote:
Originally Posted by Cycle
Посмотреть сообщение
Nгo fechei a abertura da callback. Desculpa.
PHP код:
public OnPlayerSelectedMenuRow(playerid,row)  
{  
new 
Menu:current;  
current=GetPlayerMenu(playerid);  
if(
current==Trabalhos)  
{  
switch(
row)  
{  
case 
0:{  
TogglePlayerControllable(playerid1);  
SetPlayerTeam(playerid,TEAM_Caminhoneiro);  
TogglePlayerControllable(playerid1);  
}  
case 
1:{  
if(
gTeam[playerid]==TEAM_Lixeiro)  
TogglePlayerControllable(playerid1);  
SetPlayerTeam(playerid,TEAM_Lixeiro);  
TogglePlayerControllable(playerid1);  
}   



Muito Obrigado Mano! , Resolveu aqui!!!, vou ver se jб consigo dar reputaзao e te dou kkk
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)