Problem with ID
#2

Try this maybe?

pawn Код:
if(dialogid == DIALOG_DOORID)
    {
        if(response)
        {
            new doorID;
            if (sscanf(inputtext[4], "d", doorID))
            {
                cmd_door(playerid, "\1");
            }
            else {
                SetPVarInt(playerid, "EditingDoor", doorID);
                ShowPlayerDialog(playerid, DIALOG_DOORS,DIALOG_STYLE_LIST,"Edit Door","Exterior\nInterior\nName\nCustom Interior\nGarage Ability\nDelete","Choose","Close");
            }
        }
    }
    if(dialogid == DIALOG_DOORS)
    {
        if(response)
        {
            doorid = GetPVarInt(playerid, "EditingDoor");
            switch(listitem)
            {
                case 0:
                {
                    GetPlayerPos(playerid, DoorInfo[doorid][ExteriorX], DoorInfo[doorid][ExteriorY], DoorInfo[doorid][ExteriorZ]);
                    GetPlayerFacingAngle(playerid, DoorInfo[doorid][ExteriorA]);
                    DoorInfo[doorid][ExteriorVW] = GetPlayerVirtualWorld(playerid);
                    DoorInfo[doorid][ExteriorInt] = GetPlayerInterior(playerid);
                    SendClientMessage(playerid, COLOR_WHITE, "You've successfully changed the exterior.");
                    CreateDoor(doorid);
                    SaveDoors();
                }
                case 1:
                {
                }
                case 2:
                {
                    ShowPlayerDialog(playerid, DIALOG_DOORNAME,DIALOG_STYLE_INPUT,"Door Name","Type the door name below.","Ok","Close");
                }
                case 3:
                {
                    GetPlayerPos(playerid, DoorInfo[doorid][InteriorX], DoorInfo[doorid][InteriorY], DoorInfo[doorid][InteriorZ]);
                    GetPlayerFacingAngle(playerid, DoorInfo[doorid][InteriorA]);
                    DoorInfo[doorid][InteriorInt] = GetPlayerInterior(playerid);
                    DoorInfo[doorid][InteriorVW] = GetPlayerVirtualWorld(playerid);
                    DoorInfo[doorid][CustomInterior] = 1;
                    SendClientMessage(playerid, COLOR_WHITE, "You've successfully set a custom interior.");
                    SaveDoors();
                }
                case 4:
                {
                    if(DoorInfo[doorid][Vehicle] == 0)
                    {
                        DoorInfo[doorid][Vehicle] = 1;
                        SendClientMessage(playerid, COLOR_WHITE,"Vehicle Ability in this door is successfully enabled.");
                        SaveDoors();
                    }
                    if(DoorInfo[doorid][Vehicle] == 1)
                    {
                        DoorInfo[doorid][Vehicle] = 0;
                        SendClientMessage(playerid, COLOR_WHITE,"Vehicle Ability in this door is successfully disabled.");
                        SaveDoors();
                    }
                }
                case 5:
                {
                    new string[128];
                    DestroyPickup(DoorInfo[doorid][Pickup]);
                    Delete3DTextLabel(DoorInfo[doorid][TextID]);
                    DoorInfo[doorid][Text] = 0;
                    DoorInfo[doorid][CustomInterior] = 0;
                    DoorInfo[doorid][ExteriorVW] = 0;
                    DoorInfo[doorid][ExteriorInt] = 0;
                    DoorInfo[doorid][InteriorVW] = 0;
                    DoorInfo[doorid][InteriorInt] = 0;
                    DoorInfo[doorid][ExteriorX] = 0;
                    DoorInfo[doorid][ExteriorY] = 0;
                    DoorInfo[doorid][ExteriorZ] = 0;
                    DoorInfo[doorid][ExteriorA] = 0;
                    DoorInfo[doorid][InteriorX] = 0;
                    DoorInfo[doorid][InteriorY] = 0;
                    DoorInfo[doorid][InteriorZ] = 0;
                    DoorInfo[doorid][InteriorA] = 0;
                    DoorInfo[doorid][Vehicle] = 0;
                    DoorInfo[doorid][Pass] = 0;
                    DoorInfo[doorid][Locked] = 0;
                    SaveDoors();
                    format(string, sizeof(string), "You've successfully deleted door %d.", doorid);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
            }
        }
    }
    if(dialogid == DIALOG_DOORNAME)
    {
        if(response)
        {
            strmid(DoorInfo[doorid][Text], params, 0, strlen(params), 256);
            SendClientMessage(playerid, COLOR_WHITE, "You've successfully changed the name of the door.");
            CreateDoor(doorid);
            SaveDoors();
        }
    }
Reply


Messages In This Thread
Problem with ID - by TonyII - 08.09.2013, 15:27
Re: Problem with ID - by Emmet_ - 10.09.2013, 10:42

Forum Jump:


Users browsing this thread: 3 Guest(s)