SA-MP Forums Archive
Dialog not responding - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog not responding (/showthread.php?tid=441822)



Dialog not responding - ixesas - 04.06.2013

i have 2 filterscripts using the same plugin (sscanf) - admin system , property system. problem is , when i load both of the filterscripts, admin system dialogs respond, but property systems dialogs dont. i tried changing the property system returns to 0, but nothing changed


Re: Dialog not responding - SimpalK - 04.06.2013

Without codes, we cannot help you.


AW: Dialog not responding - Blackazur - 04.06.2013

Give us the code.


Re: Dialog not responding - ixesas - 04.06.2013

Property system dialogresponse:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 219)
    {
        if(response == 1)
        {
            if(GetPlayerBusinessID(playerid) == 1)return 0;
            new busid;
            format(file,sizeof(file),"Business/%i.ini",cpid[playerid]);
            if(GetPlayerBusinessID(playerid) > -1)return SendClientMessage(playerid,Red,"Jыs jau turite garaюа");
            if(dini_Int(file,"Cost") > GetPlayerMoney(playerid))return SendClientMessage(playerid,Red,"You do not have enough cash to buy this business.");
            GivePlayerMoney(playerid, -dini_Int(file,"Cost"));
            GetPlayerName(playerid,Name,sizeof(Name));
            dini_Set(file, "Name", Name);
            dini_Set(file, "Owner",Name);
            dini_IntSet(file, "OwnedBus",1);
            dini_IntSet(file, "HasOwner",1);
            format(Label, sizeof(Label), "{ccccff}%s's business\n\n{999999}%s\n{00BC00}Cost: {999999}$%i\n{00BC00}ID: {999999}%i",Name,dini_Get(file, "Owner"),dini_Int(file, "Cost"),busid);
            Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
            format(String,sizeof(String),"You have successfully purchased the %s.",dini_Get(file, "Name"));
            SendClientMessage(playerid,Green,String);
        }
        if(response == 0)
        {
            SendClientMessage(playerid,Yellow,"You chose not to buy this business");
        }
        return 1;
    }
    if(dialogid == 220)
    {
        if(response == 1)
        {
            GetPlayerName(playerid,Name,sizeof(Name));
            format(file,sizeof(file),"Business/%i.ini",GetPlayerBusinessID(playerid));
            format(Label, sizeof(Label), "{ccccff}For Sale\n\n{999999}No Owner\n{00BC00}Cost: {999999}$%i",dini_Get(file, "Name"),dini_Int(file, "Cost"));
            Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
            dini_Set(file, "Owner","No Owner");
            dini_IntSet(file, "Cost",dini_Int(file, "Cost"));
            dini_IntSet(file, "OwnedBus",0);
            dini_IntSet(file, "HasOwner",0);
            GivePlayerMoney(playerid,dini_Int(file, "Cost")/2);
            SendClientMessage(playerid,Green,"You have sold your business and recieved 50 percent of the price.");
        }
        return 1;
    }
    return 0;
}

Administration system dialogresponse:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        switch(dialogid)
        {
            case GARAZAS_DIALOG :
            {
                switch (listitem)
                {
                    if(GetPlayerBusinessID(playerid) == 1)return 0;
                    new busid, file[128];
                    format(file,sizeof(file),"Business/%i.ini",cpid[playerid]);
                    if(GetPlayerBusinessID(playerid) > -1)return SendClientMessage(playerid,Red,"Jыs jau turite garaюа");
                    if(dini_Int(file,"Cost") > GetPlayerMoney(playerid))return SendClientMessage(playerid,Red,"You do not have enough cash to buy this business.");
                    GivePlayerMoney(playerid, -dini_Int(file,"Cost"));
                    GetPlayerName(playerid,Name,sizeof(Name));
                    dini_Set(file, "Name", Name);
                    dini_Set(file, "Owner",Name);
                    dini_IntSet(file, "OwnedBus",1);
                    dini_IntSet(file, "HasOwner",1);
                    format(Label, sizeof(Label), "{ccccff}%s's business\n\n{999999}%s\n{00BC00}Cost: {999999}$%i\n{00BC00}ID: {999999}%i",Name,dini_Get(file, "Owner"),dini_Int(file, "Cost"),busid);
                    Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
                    format(String,sizeof(String),"You have successfully purchased the %s.",dini_Get(file, "Name"));
                    SendClientMessage(playerid,Green,String);
                }
                return 1;
            }
            case PASLAUGOS_DIALOG :
            {
                switch (listitem)
                {
                    case 0 : ShowPlayerDialog( playerid, PASLAUGOS_DIALOG+1, DIALOG_STYLE_MSGBOX, ""orange"Taрkш keitimas б VIP", ""white"VIP paslauga kainuoja 100 юaidimo taрkш\nЮaidimo taрkus gaunate kas 10 minuиiш\n"red"Visi taрkai sekami, todлl praрome neapgaudinлti"white"\n\n---\n\nNorлdami iрsikeisti 100 ЮT б VIP:\n1. Spauskite mygtukа SUTINKU apaиioje\n2. "orange"(REKOMENDUOJAMA) "white"Perkrauti юaidimа\n3. Prisijungus patikrinkite komandas (/VKomandos)", "Sutinku", "Iрeiti");
                    case 1 : ShowPlayerDialog( playerid, PASLAUGOS_DIALOG+2, DIALOG_STYLE_MSGBOX, ""red"Taрkш keitimas б 1LVL Admin", ""white"Admin paslauga kainuoja 250 юaidimo taрkш\nЮaidimo taрkus gaunate kas 10 minuиiш\n"red"Visi taрkai sekami, todлl praрome neapgaudinлti"white"\n\n---\n\nNorлdami iрsikeisti 250 ЮT б Admin:\n1. Spauskite mygtukа SUTINKU apaиioje\n2. "orange"(REKOMENDUOJAMA) "white"Perkrauti юaidimа\n3. Prisijungus patikrinkite komandas (/AKomandos)", "Sutinku", "Iрeiti");
                    case 2 : ShowPlayerDialog( playerid, PASLAUGOS_DIALOG+3, DIALOG_STYLE_MSGBOX, ""green"Garaюai", ""orange"Apie garaюш sistemа:\n"white"Surinkus 300 юaidimo taрkш, jыs turлsite galimybж бsigyti vienа iр\n12-os serverio garaюш. Nusipirkж garaюа bыsite бtrauktas б garaюш\nsavininkш sаraрa, bei gausite papildomus ЮT uю savo garaюа.\nGaraюe galлsite tiuninguoti papildomas transporto dalis.\nSpauskite nusikelti, norлdami atsirasti garaюuose", "Nusikelti", "Iрeiti");
                }
                return 1;
            }
etc.............
    return 0;
}



Re: Dialog not responding - arakuta - 04.06.2013

Just don't use the same ID's for dialogs.

Check the dialogs ID's then change them if you got duplicated.


Re: Dialog not responding - ixesas - 04.06.2013

Quote:
Originally Posted by arakuta
Посмотреть сообщение
Just don't use the same ID's for dialogs.

Check the dialogs ID's then change them if you got duplicated.
Nope, id's dont duplicate. Already checked it.


Re: Dialog not responding - [Ro]DuReX - 04.06.2013

Add a system in your gamemode.


Re: Dialog not responding - ixesas - 04.06.2013

Quote:
Originally Posted by [Ro]DuReX
Посмотреть сообщение
Add a system in your gamemode.
Getting lot of errors after including <dini>


Re: Dialog not responding - NvidiaForTheWin - 04.06.2013

switch from dini to y_ini. proven to be faster and use less computer resource. super easy even for a beginner that can at least read the code

what i did when i had trouble with dialog , i started a new FS and remade it taking care of id.
it also helped me understand better how dialog work.

now i'm using fdialog include , way easier for me.

https://sampforum.blast.hk/showthread.php?tid=260298


Re: Dialog not responding - ixesas - 05.06.2013

Quote:
Originally Posted by NvidiaForTheWin
Посмотреть сообщение
switch from dini to y_ini. proven to be faster and use less computer resource. super easy even for a beginner that can at least read the code

what i did when i had trouble with dialog , i started a new FS and remade it taking care of id.
it also helped me understand better how dialog work.

now i'm using fdialog include , way easier for me.

https://sampforum.blast.hk/showthread.php?tid=260298
I trying to download it, but i dont understand this system responsing to dialog.