Dialog not responding
#1

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
Reply
#2

Without codes, we cannot help you.
Reply
#3

Give us the code.
Reply
#4

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;
}
Reply
#5

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

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

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.
Reply
#7

Add a system in your gamemode.
Reply
#8

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

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)