[Ajuda] erro no case 0:
#1

Olб internautas

Quote:

D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(333) : error 014: invalid statement; not in switch
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(333) : warning 215: expression has no effect
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(333) : error 001: expected token: ";", but found ":"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(333) : error 029: invalid expression, assumed zero
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(333) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

pawn Code:
case 0:  //Estб й a linha (333)
Cуdigo completo :
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

    if(dialogid == ALUGUE)
    {
        if(response)
        {
        case 0:
            if(GePlayerMoney(playerid) < 370) return SendClientMessage(playerid,COLOR_AZULCLARO,"| HOTEL | Vocк nгo tem R$370 para alugar!");
            if(GetPVarInt(playerid,"Sono") >= 75) return SendClientMessage(playerid,COLOR_AZULCLARO,"| SONO | Vocк nгo esta com sono!");
            SetPlayerPos(playerid, 2246.4041,-1164.5934,1030.4943);
            SetPlayerPos(playerid, 2252.9849,-1158.8644,1030.4410);
            SetPlayerPos(playerid, 2236.0242,-1154.6893,1030.4943);
            SetPlayerPos(playerid, 2229.6047,-1160.9651,1030.4410);
            SetPlayerPos(playerid, 2235.9683,-1165.5596,1030.4943);
            SetPlayerPos(playerid, 2230.5610,-1183.3994,1030.5249);
            SetPlayerPos(playerid, 2224.5496,-1176.9550,1030.4384);
            SetPlayerPos(playerid, 2204.6062,-1193.9602,1030.5249);
            SetPlayerPos(playerid, 2210.6392,-1200.2861,1030.4384);
            SetPlayerPos(playerid, 2230.8987,-1183.3547,1030.5249);
            SetPlayerPos(playerid, 2224.0601,-1176.9796,1030.4384);
            SetPlayerPos(playerid, 2198.2258,-1178.0868,1030.4943);
            SetPlayerPos(playerid, 2204.8206,-1171.5645,1030.4410);
            SetPlayerPos(playerid, 2187.9077,-1151.9406,1030.4943);
            SetPlayerPos(playerid, 2181.5906,-1158.4785,1030.4410);
            SetPlayerPos(playerid, 2217.3391,-1146.4551,1025.7969);
            SendClientMessage(playerid,COLOR_AZULCLARO, "| HOTEL | Vб para a cama e digite --> /Durmir");
            GivePlayerMoney(playerid, -370);

     }
        else
        {
            SendClientMessage(playerid,COLOR_AZULCLARO, "| HOTEL | Vocк optou por nгo alugar.");
        }
    }
    return 0;
}
Bom, o que estou tentando fazer й criar um DIalog para o player alugar um quarto no Hotel . Quando ele aluga ele serб teleportado a um dos quartos (SetPlayerPos) . Mais quando eu tiro o
pawn Code:
case 0:
ele pede o
pawn Code:
case 0:
e fica dando os erros que citei acima .
Reply
#2

pawn Code:
switch(listitem)
{
    case 0:
    {
    }
}
esqueceu o switch
Reply
#3

Quote:
Originally Posted by PT
View Post
pawn Code:
switch(listitem)
{
    case 0:
    {
    }
}
esqueceu o switch
Nгo foi Portuga, ele deu mais erros :/
Reply
#4

Retire o case 0:.

Abraзos.
Reply
#5

Quote:
Originally Posted by Dolby
View Post
Retire o case 0:.

Abraзos.
Obrigado por tentar me ajudar, mais como disse se eu retiro o
pawn Code:
case 0:
ele da erro e pede o
pawn Code:
case 0:
. E se eu deixo ele tambйm da erro .
Reply
#6

alwe... o case sу usado a seguir a um "switch" se nгo usas switch nгo podes usar o case, por isso retira-o e mostra os erros que dб...
Reply
#7

Com
Code:
case 0:
pawn Code:
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(338) : warning 217: loose indentation
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(338) : error 017: undefined symbol "GePlayerMoney"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(364) : warning 209: function "OnDialogResponse" should return a value
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(365) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(368) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(370) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(371) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(373) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(375) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(376) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(381) : error 021: symbol already defined: "SetProgressBarValue"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(381) : error 017: undefined symbol "playerid"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(381) : error 021: symbol already defined: "UpdateProgressBar"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(381 -- 382) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


12 Errors.

//CODIGO
    if(dialogid == ALUGUE)
    {
        if(response, listitem)
        switch(listitem)
    {
        case 0:
    {
    }
}
Sem
Code:
case 0:
pawn Code:
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(336) : warning 217: loose indentation
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(336) : error 017: undefined symbol "GePlayerMoney"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(357) : warning 209: function "OnDialogResponse" should return a value
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(358) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(363) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(366) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(368) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(369) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(371) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(373) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(374) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(379) : error 021: symbol already defined: "SetProgressBarValue"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(379) : error 017: undefined symbol "playerid"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(379) : error 021: symbol already defined: "UpdateProgressBar"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(379 -- 380) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


13 Errors.
//CODIGO
    if(dialogid == ALUGUE)
    {
        if(response, listitem)
        switch(listitem)
    {
    }
}
Reply
#8

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(response)
    {
        case ALUGUE:
        {
            if(!response)
                return SendClientMessage(playerid,COLOR_AZULCLARO, "| HOTEL | Vocк optou por nгo alugar.");
               
            if(GePlayerMoney(playerid) < 370)
                return SendClientMessage(playerid,COLOR_AZULCLARO,"| HOTEL | Vocк nгo tem R$370 para alugar!");
            if(GetPVarInt(playerid,"Sono") >= 75)
                return SendClientMessage(playerid,COLOR_AZULCLARO,"| SONO | Vocк nгo esta com sono!");
           
            SetPlayerPos(playerid, 2246.4041,-1164.5934,1030.4943);
            SetPlayerPos(playerid, 2252.9849,-1158.8644,1030.4410);
            SetPlayerPos(playerid, 2236.0242,-1154.6893,1030.4943);
            SetPlayerPos(playerid, 2229.6047,-1160.9651,1030.4410);
            SetPlayerPos(playerid, 2235.9683,-1165.5596,1030.4943);
            SetPlayerPos(playerid, 2230.5610,-1183.3994,1030.5249);
            SetPlayerPos(playerid, 2224.5496,-1176.9550,1030.4384);
            SetPlayerPos(playerid, 2204.6062,-1193.9602,1030.5249);
            SetPlayerPos(playerid, 2210.6392,-1200.2861,1030.4384);
            SetPlayerPos(playerid, 2230.8987,-1183.3547,1030.5249);
            SetPlayerPos(playerid, 2224.0601,-1176.9796,1030.4384);
            SetPlayerPos(playerid, 2198.2258,-1178.0868,1030.4943);
            SetPlayerPos(playerid, 2204.8206,-1171.5645,1030.4410);
            SetPlayerPos(playerid, 2187.9077,-1151.9406,1030.4943);
            SetPlayerPos(playerid, 2181.5906,-1158.4785,1030.4410);
            SetPlayerPos(playerid, 2217.3391,-1146.4551,1025.7969);
            SendClientMessage(playerid,COLOR_AZULCLARO, "| HOTEL | Vб para a cama e digite --> /Durmir");
            GivePlayerMoney(playerid, -370);
        }
    }
    return 0;
}
E espero que pare de me chamar Portuga o meu nick e PT, guarde mais respeito, pois nunca lhe faltei ao seu!
Reply
#9

-.- A seguir ao "switch(listitem)" tens que usar o case tu antes nao tinhas o case...

Linha 336 й GetPlayerMoney, nгo GePlayerMoney
Linha 357 diz que te falta o return
Linha 358,363,366,368,369,371,373,374 Diz deves ter lб alguma coisa que nгo devias ter que nao tem significanho nenhum
Linha 379 estбs a redefinir algo que jб estб definido
Reply
#10

Quote:
Originally Posted by PT
View Post
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(response)
    {
        case ALUGUE:
        {
            if(!response)
                return SendClientMessage(playerid,COLOR_AZULCLARO, "| HOTEL | Vocк optou por nгo alugar.");
               
            if(GePlayerMoney(playerid) < 370)
                return SendClientMessage(playerid,COLOR_AZULCLARO,"| HOTEL | Vocк nгo tem R$370 para alugar!");
            if(GetPVarInt(playerid,"Sono") >= 75)
                return SendClientMessage(playerid,COLOR_AZULCLARO,"| SONO | Vocк nгo esta com sono!");
           
            SetPlayerPos(playerid, 2246.4041,-1164.5934,1030.4943);
            SetPlayerPos(playerid, 2252.9849,-1158.8644,1030.4410);
            SetPlayerPos(playerid, 2236.0242,-1154.6893,1030.4943);
            SetPlayerPos(playerid, 2229.6047,-1160.9651,1030.4410);
            SetPlayerPos(playerid, 2235.9683,-1165.5596,1030.4943);
            SetPlayerPos(playerid, 2230.5610,-1183.3994,1030.5249);
            SetPlayerPos(playerid, 2224.5496,-1176.9550,1030.4384);
            SetPlayerPos(playerid, 2204.6062,-1193.9602,1030.5249);
            SetPlayerPos(playerid, 2210.6392,-1200.2861,1030.4384);
            SetPlayerPos(playerid, 2230.8987,-1183.3547,1030.5249);
            SetPlayerPos(playerid, 2224.0601,-1176.9796,1030.4384);
            SetPlayerPos(playerid, 2198.2258,-1178.0868,1030.4943);
            SetPlayerPos(playerid, 2204.8206,-1171.5645,1030.4410);
            SetPlayerPos(playerid, 2187.9077,-1151.9406,1030.4943);
            SetPlayerPos(playerid, 2181.5906,-1158.4785,1030.4410);
            SetPlayerPos(playerid, 2217.3391,-1146.4551,1025.7969);
            SendClientMessage(playerid,COLOR_AZULCLARO, "| HOTEL | Vб para a cama e digite --> /Durmir");
            GivePlayerMoney(playerid, -370);
        }
    }
    return 0;
}
E espero que pare de me chamar Portuga o meu nick e PT, guarde mais respeito, pois nunca lhe faltei ao seu!
Quote:

D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(335) : error 017: undefined symbol "GePlayerMoney"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(363) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(365) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(366) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(36 : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(370) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(371) : error 010: invalid function or declaration
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(376) : error 021: symbol already defined: "SetProgressBarValue"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(376) : error 017: undefined symbol "playerid"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(376) : error 021: symbol already defined: "UpdateProgressBar"
D:\Users\ZЈU\Desktop\Nova pasta\filterscripts\Untitled.pwn(376 -- 377) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


11 Errors.

Ah e desculpa por te chamar de Portuga ^^ й que como seu nome ta PT e fala que localidade й de Portugal ai tomei a liberdade de Chamar de Portuga por causa da sigla PT
Se quiser eu mando as linhas do erro .
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)