My game crashes cause of Dialogs..
#3

The problem is in your switch().
pawn Code:
switch(1337)
Inside () there must be a variable, not a constant. I would suggest to use if, else if, if you don't know how switch works.
This is the wa it sholud be.
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid) // Lookup the dialogid /* changed here */
    {
        case 1337: /*changed here*/
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "Please select a spawn place.");/* I would Add here same ShowPlayerDialog() line*/
                return 1; // We processed it
            }

            switch(listitem) // This is far more efficient than using an if-elseif-else structure
            {
                case 0: // Listitems start with 0, not 1
                {
                    SetPlayerPos(playerid, 2001.7556,1544.1254,13.5859);
                    SetPlayerFacingAngle(playerid, 271.6154);
                }
                case 1:
                {
                    SetPlayerPos(playerid, 2448.8062,-1705.2867,13.5123);
                    SetPlayerFacingAngle(playerid, 85.3487);
                }
                case 2:
                {
                    SetPlayerPos(playerid, -1960.3412,266.8877,35.4688);
                    SetPlayerFacingAngle(playerid, 272.9387);
                }
                // Add the rest of your listitems for dialog 1 here

            }

        }
        // Add the rest of your dialogs here

    }
    return 0; // If you put return 1 here the callback will not continue to be called in other scripts (filterscripts, etc.).
}
Reply


Messages In This Thread
My game crashes cause of Dialogs.. - by Ehab1911 - 22.07.2011, 12:19
Re: My game crashes cause of Dialogs.. - by Ehab1911 - 22.07.2011, 12:24
Re: My game crashes cause of Dialogs.. - by Roko_foko - 22.07.2011, 12:33
Re: My game crashes cause of Dialogs.. - by Ehab1911 - 22.07.2011, 12:57
Re: My game crashes cause of Dialogs.. - by Roko_foko - 22.07.2011, 13:01

Forum Jump:


Users browsing this thread: 1 Guest(s)