SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 01/06/2020, 08:50 PM   #1
SkolPlay
Big Clucker
 
Join Date: Aug 2016
Posts: 197
Reputation: 0
Default OnDialogResponse

Bom eu baixei a gm onde tem sobre os Attached pra pegar posição e tals, dai eu peguei a base que tem na gm editei e to tentando colocar na minha gm, porém quando vou copilar para de funcionar
pawn Code:
#define DIALOG_ATTACH_INDEX             13500
#define DIALOG_ATTACH_INDEX_SELECTION   DIALOG_ATTACH_INDEX+1
#define DIALOG_ATTACH_EDITREPLACE       DIALOG_ATTACH_INDEX+2
#define DIALOG_ATTACH_MODEL_SELECTION   DIALOG_ATTACH_INDEX+3
#define DIALOG_ATTACH_BONE_SELECTION    DIALOG_ATTACH_INDEX+4

switch(dialogid)
    {
        case DIALOG_ATTACH_INDEX_SELECTION:
        {
            if(response)
            {
                if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
                {
                    ShowPlayerDialog(playerid, DIALOG_ATTACH_EDITREPLACE, DIALOG_STYLE_MSGBOX, \
                    "{FF0000}Attachment Modification", "Deseja editar o anexo nesse slot ou excluí-lo?", "Editar", "Deletar");
                }
                else
                {
                    new string[4000+1];
                    for(new x;x<sizeof(AttachmentObjects);x++)
                    {
                        format(string, sizeof(string), "%s%s\n", string, AttachmentObjects[x][attachname]);
                    }
                    ShowPlayerDialog(playerid, DIALOG_ATTACH_MODEL_SELECTION, DIALOG_STYLE_LIST, \
                    "{FF0000}Modificação de anexo - Seleção de modelo", string, "Selecionar", "Cancelar");
                }
                SetPVarInt(playerid, "AttachmentIndexSel", listitem);
            }
            return 1;
        }
        case DIALOG_ATTACH_EDITREPLACE:
        {
            if(response) EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
            else RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
            DeletePVar(playerid, "AttachmentIndexSel");
            return 1;
        }
        case DIALOG_ATTACH_MODEL_SELECTION:
        {
            if(response)
            {
                if(GetPVarInt(playerid, "AttachmentUsed") == 1) EditAttachedObject(playerid, listitem);
                else
                {
                    SetPVarInt(playerid, "AttachmentModelSel", AttachmentObjects[listitem][attachmodel]);
                    new string[256+1];
                    for(new x;x<sizeof(AttachmentBones);x++)
                    {
                        format(string, sizeof(string), "%s%s\n", string, AttachmentBones[x]);
                    }
                    ShowPlayerDialog(playerid, DIALOG_ATTACH_BONE_SELECTION, DIALOG_STYLE_LIST, \
                    "{FF0000}Modificação de anexos - Seleção óssea", string, "Selecionar", "Cancelar");
                }
            }
            else DeletePVar(playerid, "AttachmentIndexSel");
            return 1;
        }
        case DIALOG_ATTACH_BONE_SELECTION:
        {
            if(response)
            {
                SetPlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"), GetPVarInt(playerid, "AttachmentModelSel"), listitem+1);
                EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
            }
            DeletePVar(playerid, "AttachmentIndexSel");
            DeletePVar(playerid, "AttachmentModelSel");
            return 1;
        }
    }
SkolPlay is online now   Reply With Quote
Old 01/06/2020, 10:33 PM   #2
Miqueias Barros
Gangsta
 
Miqueias Barros's Avatar
 
Join Date: May 2010
Location: Brazil 🇧🇷
Posts: 725
Reputation: 34
Default Re: OnDialogResponse

Tira as returns das cases e altera esse dialogid dessa forma
pawn Code:
case DIALOG_ATTACH_EDITREPLACE:
        {
            if(response)
            {
                        EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
            }
            else
            {
                        RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
                        DeletePVar(playerid, "AttachmentIndexSel");
            }
        }
__________________
Gamemode está no substantivo masculino que traduzido quer dizer "modo de jogo", portanto a expressão não é: "essa gamemode, a gamemode..." e sim: "esse gamemode, o gamemode...".
Miqueias Barros is offline   Reply With Quote
Old 01/06/2020, 10:49 PM   #3
SkolPlay
Big Clucker
 
Join Date: Aug 2016
Posts: 197
Reputation: 0
Default Re: OnDialogResponse

Quote:
Originally Posted by Miqueias Barros View Post
Tira as returns das cases e altera esse dialogid dessa forma
pawn Code:
case DIALOG_ATTACH_EDITREPLACE:
        {
            if(response)
            {
                        EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
            }
            else
            {
                        RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
                        DeletePVar(playerid, "AttachmentIndexSel");
            }
        }
Copilou certinho, mas notei um problema, quando vou adicionar dois acessórios um some
SkolPlay is online now   Reply With Quote
Old 01/06/2020, 11:52 PM   #4
PaulinSAMP
Big Clucker
 
PaulinSAMP's Avatar
 
Join Date: Apr 2020
Location: San Andreas
Posts: 86
Reputation: 3
Default Re: OnDialogResponse

Quote:
Originally Posted by SkolPlay View Post
Copilou certinho, mas notei um problema, quando vou adicionar dois acessórios um some
Pesquise mais sobre isso e isso pdc relacionado com o samp que n suporta e tals, pss está enganado
PaulinSAMP is offline   Reply With Quote
Old 02/06/2020, 12:06 AM   #5
k2bi
Big Clucker
 
k2bi's Avatar
 
Join Date: Sep 2017
Location: Novo Horizonte - SP
Posts: 186
Reputation: 5
Default Re: OnDialogResponse

Verifique o seu SetPlayerAttachedObject.
Os slots permitido vai de 0 à 9, se for maior que isso, vai dar problema.
k2bi is offline   Reply With Quote
Old 02/06/2020, 12:23 AM   #6
Miqueias Barros
Gangsta
 
Miqueias Barros's Avatar
 
Join Date: May 2010
Location: Brazil 🇧🇷
Posts: 725
Reputation: 34
Default Re: OnDialogResponse

Quote:
Originally Posted by SkolPlay View Post
Copilou certinho, mas notei um problema, quando vou adicionar dois acessórios um some
Se baseie nesta documentação.
__________________
Gamemode está no substantivo masculino que traduzido quer dizer "modo de jogo", portanto a expressão não é: "essa gamemode, a gamemode..." e sim: "esse gamemode, o gamemode...".
Miqueias Barros is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnDialogResponse [+REP] EgyptForLife Scripting Help 5 02/10/2015 12:04 PM
ondialogresponse help xTURBOx Scripting Help 2 18/09/2015 03:32 PM
OnDialogResponse ChristolisTV Server Support 5 06/09/2015 12:48 PM
OnDialogResponse Edvin Scripting Help 3 02/10/2011 10:22 AM
OnDialogResponse Wesley221 Help Archive 2 02/05/2011 03:21 PM


All times are GMT. The time now is 11:48 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.