SA-MP Forums Archive
[Ajuda] Ajuda aqui pro nb - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Ajuda aqui pro nb (/showthread.php?tid=370435)



Ajuda aqui pro nb - Owtsiixx_Twd - 20.08.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    CMD:lojadearmas(playerid, params[])
    {
    ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "Loja De Armas", "Ealge\nSniper\nM4\nMP5\nFaca\nRebite", "Comprar", "Cancela");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 123)
    {
        if(response == 0)
        {
            if(listitem == 0)
            {
                 GivePlayerWeapon(playerid, 4, 1);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 Faca")
                return 1;
            }
            if(listitem == 1)
            {
                 GivePlayerWeapon(playerid, 24, 150);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 Eagle Com 150 Balas")
                return 1;
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 34, 150);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 Sniper Com 150 Balas");
                return 1;
            }
            if(listitem == 3)
            {
                GivePlayerWeapon(playerid, 31, 300);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 M4 Com 300 Balas");
                return 1;
            }
            if(listitem == 4)
            {
                GivePlayerWeapon(playerid, 29, 300);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 MP5 Com 300 Balas");
                return 1;
            }
            if(listitem == 5)
            {
                GivePlayerWeapon(playerid, 25, 100);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 Rebite Com 100 Balas");
                return 1;
            }
        }
    }
}
erros
pawn Код:
C:\Users\Juninho\Desktop\BVN.pwn(67) : error 029: invalid expression, assumed zero
C:\Users\Juninho\Desktop\BVN.pwn(67) : error 017: undefined symbol "cmd_lojadearmas"
C:\Users\Juninho\Desktop\BVN.pwn(67) : error 029: invalid expression, assumed zero
C:\Users\Juninho\Desktop\BVN.pwn(67) : fatal error 107: too many error messages on one line

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


4 Errors.
Linha 67
Todos os erros estao na linha 67 oque tem la?
pawn Код:
CMD:lojadearmas(playerid, params[])



Re: Ajuda aqui pro nb - Crueliz0n - 20.08.2012

zcmd й fora da OnPlayerCommandText


pawn Код:
CMD:lojadearmas(playerid, params[])
{
    ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "Loja De Armas", "Ealge\nSniper\nM4\nMP5\nFaca\nRebite", "Comprar", "Cancela");
    return true.
}



Re: Ajuda aqui pro nb - Owtsiixx_Twd - 20.08.2012

Quote:
Originally Posted by BlackDonelly
Посмотреть сообщение
zcmd й fora da OnPlayerCommandText


pawn Код:
CMD:lojadearmas(playerid, params[])
{
    ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "Loja De Armas", "Ealge\nSniper\nM4\nMP5\nFaca\nRebite", "Comprar", "Cancela");
    return true.
}
Fiz isso e deu

pawn Код:
C:\Users\Juninho\Desktop\BVN.pwn(79) : warning 217: loose indentation
C:\Users\Juninho\Desktop\BVN.pwn(80) : error 001: expected token: ";", but found "return"
C:\Users\Juninho\Desktop\BVN.pwn(85) : warning 217: loose indentation
C:\Users\Juninho\Desktop\BVN.pwn(86) : error 001: expected token: ";", but found "return"
C:\Users\Juninho\Desktop\BVN.pwn(114) : warning 209: function "OnDialogResponse" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.



Re: Ajuda aqui pro nb - Crueliz0n - 20.08.2012

opps erro meu


й return true;


Re: Ajuda aqui pro nb - Owtsiixx_Twd - 20.08.2012

pawn Код:
CMD:lojadearmas(playerid, params[])
{
    ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "Loja De Armas", "Ealge\nSniper\nM4\nMP5\nFaca\nRebite", "Comprar", "Cancela");
    return true;
}
ta dese jeito ai mais continua os mesmos erros ;(


Re: Ajuda aqui pro nb - R3S1D3NT1 - 20.08.2012

vc usa a public OnPlayerCommandText e usa zcmd dentro dela ? tenso nгo usa zcmd na public i coloca la em cima #include <zcmd>
caso vc use strcmp passe ese code para strcmp tbm n use um cmd de strcmp e zcmd junto n amiguinho


Re: Ajuda aqui pro nb - Owtsiixx_Twd - 20.08.2012

Quote:
Originally Posted by R3S1D3NT1
Посмотреть сообщение
vc usa a public OnPlayerCommandText e usa zcmd dentro dela ? tenso nгo usa zcmd na public i coloca la em cima #include <zcmd>
eu ja fiz isso dai eu retirei da public e deu esses erros que eu postei ai em cima e do return eu ja arrumei


Re: Ajuda aqui pro nb - darkxdll - 20.08.2012

Usa return 1;
antes do ultimo } da onplayerdialogresponse
aff.



Re: Ajuda aqui pro nb - Since` - 20.08.2012

Estava faltando um ; na segunda SCM

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 123)
    {
        if(response == 0)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 4, 1);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 Faca");
                return 1;
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 24, 150);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 Eagle Com 150 Balas");
                return 1;
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 34, 150);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 Sniper Com 150 Balas");
                return 1;
            }
            if(listitem == 3)
            {
                GivePlayerWeapon(playerid, 31, 300);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 M4 Com 300 Balas");
                return 1;
            }
            if(listitem == 4)
            {
                GivePlayerWeapon(playerid, 29, 300);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 MP5 Com 300 Balas");
                return 1;
            }
            if(listitem == 5)
            {
                GivePlayerWeapon(playerid, 25, 100);
                SendClientMessage(playerid,COLOR_VERMELHO,"Vocк Recebeu 1 Rebite Com 100 Balas");
                return 1;
            }
        }
    }
    return 1;
}
pawn Код:
CMD:lojadearmas(playerid, params[])
{
    ShowPlayerDialog(playerid, 123, DIALOG_STYLE_LIST, "Loja De Armas", "Ealge\nSniper\nM4\nMP5\nFaca\nRebite", "Comprar", "Cancela");
    return 1;
}