SA-MP Forums Archive
Dialog blocked? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog blocked? (/showthread.php?tid=218219)



Dialog blocked? - bartje01 - 29.01.2011

Hey guys, I'm making a MDC system.
But something in this code blocks to open the dialog 22

pawn Код:
switch(dialogid) // Lookup the dialogid
    {
        case 20:
        {
            if(!response)
            {

                return 1;
            }

            switch(listitem)
            {
               
                case 0:
                {
                ShowPlayerDialog(playerid,21,DIALOG_STYLE_INPUT,"Civ.Information","Fill in a playerid","Ok","Cancel");
                }
                case 1:
                {
                new string[256];
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                if(IsPlayerConnected(i))
                {
                if(PlayerInfo[i][wantedlevel] == 1)
                {
                new name[128];
                GetPlayerName(i,name,128);
                format(string, 256, "%s", name);
                ShowPlayerDialog(playerid,22,DIALOG_STYLE_MSGBOX,"Suspects",string,"Ok","Cancel");
                }
            }
        }
        }
    }
}
}
So what blocks to show dialog 22 in case:1 ?


Re: Dialog blocked? - Danny - 29.01.2011

It's sounds stupid, but do you know for sure that the dialog id 22 isn't used already?

Some tips:
The maxium lenght of a playername in SA:MP is 24, so its better to shorten 'string' to 24 characters instead of 256. On this way, you're saving some cells.

Replace 'name[128]' with name[MAX_PLAYER_NAME], it will save cells too, and decrease lagg.

EDIT: Try to put print() messages in your code to see where it goes wrong.

Veel succes uchiha


Re: Dialog blocked? - bartje01 - 29.01.2011

Quote:
Originally Posted by -Danny-
Посмотреть сообщение
It's sounds stupid, but do you know for sure that the dialog id 22 isn't used already?

Some tips:
The maxium lenght of a playername in SA:MP is 24, so its better to shorten 'string' to 24 characters instead of 256. On this way, you're saving some cells.

Replace 'name[128]' with name[MAX_PLAYER_NAME], it will save cells too, and decrease lagg.

EDIT: Try to put print() messages in your code to see where it goes wrong.

Veel succes uchiha
I'm sure that it's not used :P I also tried other ID's

And about the cells.
I know ;P Thanks anyways>>


Lol danny xD


Re: Dialog blocked? - ricardo178 - 29.01.2011

I will give a stupid answer but i hope you don't be mad... If you change return 1; to return 0; dont change nothing? I dotn udnerstund mutch about dialogs.... sorry!


Re: Dialog blocked? - bartje01 - 29.01.2011

Nop :P