Dialog problmes
#1

Hey I am having probs with dialog

My code:
pawn Код:
//EMS DIALOG
       
            case DIALOG_EMS_CLOTHING: {
                if(response) switch(listitem) {
                    case 0: ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_OFFICIAL, DIALOG_STYLE_LIST, "Official Clothing", "Fireman Green\nFireman Yellow/Fireman Black\nParamedic White\nParamedic Blue/Paramedic Green", "Select", "Cancel");
                    case 1: ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_CUSTOM, DIALOG_STYLE_INPUT, "Custom Selection", "Enter a skin ID you wish to use.", "Select", "Cancel");
                }
            }
            case DIALOG_EMS_CLOTHING_OFFICIAL: {
                if(response) switch(listitem) {
                    case 0: {
                        SetPlayerSkin(playerid, 277);
                        playerVariables[playerid][pSkin] = 277;
                    }
                    case 1: {
                        SetPlayerSkin(playerid, 278);
                        playerVariables[playerid][pSkin] = 278;
                    }
                    case 2: {
                        SetPlayerSkin(playerid, 279);
                        playerVariables[playerid][pSkin] = 279;
                    }
                    case 3: {
                        SetPlayerSkin(playerid, 274);
                        playerVariables[playerid][pSkin] = 274;
                    }
                    case 4: {
                        SetPlayerSkin(playerid, 275);
                        playerVariables[playerid][pSkin] = 275;
                    }
                    case 5: {
                        SetPlayerSkin(playerid, 276);
                        playerVariables[playerid][pSkin] = 276;
                    }
                }
            }
            case DIALOG_EMS_CLOTHING_CUSTOM: {
                if(!response) return 1;
                new skin;
                if(sscanf(inputtext,"d",skin)) return ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_CUSTOM, DIALOG_STYLE_INPUT, "Custom Selection", "Invalid skin.\r\nEnter a skin ID you wish to use.", "Select", "Cancel"); {
                    if(!IsValidSkin(skin)) return ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_CUSTOM, DIALOG_STYLE_INPUT, "Custom Selection", "Invalid skin.\r\nEnter a skin ID you wish to use.", "Select", "Cancel");
                    switch(skin) {
                        case 282, 283, 286, 288: return ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_CUSTOM, DIALOG_STYLE_INPUT, "Custom Selection", "Invalid skin.\r\nEnter a skin ID you wish to use.", "Select", "Cancel");
                        default: {
                            SetPlayerSkin(playerid, skin);
                            playerVariables[playerid][pSkin] = skin;
                        }
                    }
                }
            }
            case DIALOG_EMS_EQUIPMENT: {
                if(response) switch(listitem) {
                    case 0: ShowPlayerDialog(playerid, EMS_DIALOG_EQUIPMENT1, DIALOG_STYLE_LIST, "Equipment", "Camera\nFire Extinguisher", "Select", "Cancel");
                }
            }
        case EMS_DIALOG_EQUIPMENT1: {
            if(response) switch(listitem) {
                case 0: givePlayerValidWeapon(playerid, 43) && PlayerPlaySound(playerid, 1052, 0, 0, 0);
                case 1: givePlayerValidWeapon(playerid, 42) && PlayerPlaySound(playerid, 1052, 0, 0, 0);
            }
        //EMS DIALOG END
I looked at the PD dialog:

pawn Код:
case DIALOG_LSPD_CLOTHING: {
                if(response) switch(listitem) {
                    case 0: ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_OFFICIAL, DIALOG_STYLE_LIST, "Official Clothing", "Probationary Officer\nPatrol/Specialist Officer\nTRU Patrol\nMotorcycle/Aircraft\nAfrican American\nOverweight\nHispanic\nTactical Gear\nSergeant\nCommander\nChief", "Select", "Cancel");
                    case 1: ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_CUSTOM, DIALOG_STYLE_INPUT, "Custom Selection", "Enter a skin ID you wish to use.", "Select", "Cancel");
                }
            }
            case DIALOG_LSPD_CLOTHING_OFFICIAL: {
                if(response) switch(listitem) {
                    case 0: {
                        SetPlayerSkin(playerid, 71);
                        playerVariables[playerid][pSkin] = 71;
                    }
                    case 1: {
                        SetPlayerSkin(playerid, 280);
                        playerVariables[playerid][pSkin] = 280;
                    }
                    case 2: {
                        SetPlayerSkin(playerid, 281);
                        playerVariables[playerid][pSkin] = 281;
                    }
                    case 3: {
                        SetPlayerSkin(playerid, 284);
                        playerVariables[playerid][pSkin] = 284;
                    }
                    case 4: {
                        SetPlayerSkin(playerid, 265);
                        playerVariables[playerid][pSkin] = 265;
                    }
                    case 5: {
                        SetPlayerSkin(playerid, 266);
                        playerVariables[playerid][pSkin] = 266;
                    }
                    case 6: {
                        SetPlayerSkin(playerid, 267);
                        playerVariables[playerid][pSkin] = 267;
                    }
                    case 7: {
                        SetPlayerSkin(playerid, 285);
                        playerVariables[playerid][pSkin] = 285;
                    }
                    case 8: {
                        if(playerVariables[playerid][pGroupRank] < 4) return SendClientMessage(playerid, COLOR_WHITE, "You're not a sergeant.");
                        SetPlayerSkin(playerid, 282);
                        playerVariables[playerid][pSkin] = 282;
                    }
                    case 9: {
                        if(playerVariables[playerid][pGroupRank] < 5) return SendClientMessage(playerid, COLOR_WHITE, "You're not a commander.");
                        SetPlayerSkin(playerid, 283);
                        playerVariables[playerid][pSkin] = 283;
                    }
                    case 10: {
                        if(playerVariables[playerid][pGroupRank] < 6) return SendClientMessage(playerid, COLOR_WHITE, "You're not the Chief of Police.");
                        SetPlayerSkin(playerid, 288);
                        playerVariables[playerid][pSkin] = 288;
                    }
                }
            }
            case DIALOG_LSPD_CLOTHING_CUSTOM: {
                if(!response) return 1;
                new skin;
                if(sscanf(inputtext,"d",skin)) return ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_CUSTOM, DIALOG_STYLE_INPUT, "Custom Selection", "Invalid skin.\r\nEnter a skin ID you wish to use.", "Select", "Cancel"); {
                    if(!IsValidSkin(skin)) return ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_CUSTOM, DIALOG_STYLE_INPUT, "Custom Selection", "Invalid skin.\r\nEnter a skin ID you wish to use.", "Select", "Cancel");
                    switch(skin) {
                        case 282, 283, 286, 288: return ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING_CUSTOM, DIALOG_STYLE_INPUT, "Custom Selection", "Invalid skin.\r\nEnter a skin ID you wish to use.", "Select", "Cancel");
                        default: {
                            SetPlayerSkin(playerid, skin);
                            playerVariables[playerid][pSkin] = skin;
                        }
                    }
                }
            }

            case DIALOG_LSPD_RELEASE: {

                new id;
                if(sscanf(inputtext,"u",id)) {
                    SendClientMessage(playerid, COLOR_GREY, "Invalid name specified (use a proper player name or ID).");
                }
                else {
                    if(IsPlayerConnectedEx(id)) {
                        if(playerVariables[id][pPrisonTime] > 0 && playerVariables[id][pPrisonID] == 3) {
                            new
                                Rstring[58],
                                playerNames[2][MAX_PLAYER_NAME];

                            playerVariables[id][pPrisonID] = 0;
                            playerVariables[id][pPrisonTime] = 0;
                            SetPlayerPos(id, 738.9963, -1417.2211, 13.5234);
                            SetPlayerInterior(id, 0);
                            SetPlayerVirtualWorld(id, 0);


                            GetPlayerName(playerid, playerNames[0], MAX_PLAYER_NAME);
                            GetPlayerName(id, playerNames[1], MAX_PLAYER_NAME);

                            switch(playerVariables[playerid][pGroupRank]) {
                                case 5: format(Rstring, sizeof(Rstring), "Dispatch: %s %s has released %s from detainment.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName5], playerNames[0], playerNames[1]);
                                case 6: format(Rstring, sizeof(Rstring), "Dispatch: %s %s has released %s from detainment.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName6], playerNames[0], playerNames[1]);
                            }
                            SendToGroup(playerVariables[playerid][pGroup], COLOR_RADIOCHAT, Rstring);

                            switch(playerVariables[playerid][pGroupRank]) {
                                case 5: format(Rstring, sizeof(Rstring), "%s %s has released you from jail.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName5], playerNames[0]);
                                case 6: format(Rstring, sizeof(Rstring), "%s %s has released you from jail.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName6], playerNames[0]);
                            }
                            SendClientMessage(id, COLOR_WHITE, Rstring);

                            format(Rstring, sizeof(Rstring), "You have successfully released %s from jail.", playerNames[1]);
                            SendClientMessage(playerid, COLOR_WHITE, Rstring);
                        }
                        else {
                            SendClientMessage(playerid, COLOR_WHITE, "That player is not jailed (in character).");
                        }
                    }
                }
            }

            case DIALOG_LSPD_CLEAR: {

                new
                    warrantid;

                if(sscanf(inputtext,"u",warrantid))
                    return SendClientMessage(playerid, COLOR_GREY, "Invalid name specified (use a proper player name or ID).");

                else if(IsPlayerConnectedEx(warrantid)) {
                    new
                        WarrantplayerNames[2][MAX_PLAYER_NAME];

                    GetPlayerName(playerid, WarrantplayerNames[0], MAX_PLAYER_NAME);
                    GetPlayerName(warrantid, WarrantplayerNames[1], MAX_PLAYER_NAME);

                    switch(playerVariables[playerid][pGroupRank]) {
                        case 5: format(szMessage, sizeof(szMessage), "Dispatch: %s %s has cleared all warrants on %s.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName5], WarrantplayerNames[0], WarrantplayerNames[1]);
                        case 6: format(szMessage, sizeof(szMessage), "Dispatch: %s %s has cleared all warrants on %s.", groupVariables[playerVariables[playerid][pGroup]][gGroupRankName6], WarrantplayerNames[0], WarrantplayerNames[1]);
                    }
                    SendToGroup(playerVariables[playerid][pGroup], COLOR_RADIOCHAT, szMessage);
                    playerVariables[warrantid][pWarrants] = 0;
                }
                else SendClientMessage(playerid, COLOR_GREY, "The specified player is not connected, or has not authenticated.");
            }
            case DIALOG_LSPD_EQUIPMENT: {
                if(response) switch(listitem) {
                    case 0: ShowPlayerDialog(playerid, LSPD_DIALOG_EQUIPMENT1, DIALOG_STYLE_LIST, "Equipment", "Nitestick\nMace\nDesert Eagle\nMP5\nShotgun\nKevlar Vest", "Select", "Cancel");
                    case 1: {
                        if(groupVariables[playerVariables[playerid][pGroup]][gswatInv] == 1) {
                            ShowPlayerDialog(playerid, LSPD_DIALOG_EQUIPMENT2, DIALOG_STYLE_LIST, "SWAT Equipment", "CS Gas ($500)\nM4A1 ($3,000)\nSPAS-12 ($5,000)\nSniper Rifle ($5,000)", "Select", "Cancel");
                        }
                        else {
                            SendClientMessage(playerid, COLOR_WHITE, "The SWAT inventory is currently unavailable.");
                        }
                    }
                }
            }
            case LSPD_DIALOG_EQUIPMENT2: {
                if(response) switch(listitem) {
                    case 0: {
                        if(groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] >= 500) {
                            groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] -= 500;
                            SendClientMessage(playerid, COLOR_WHITE, "You have withdrawn CS gas. This has cost the government $500, so use it properly.");
                            PlayerPlaySound(playerid, 1052, 0, 0, 0);
                            givePlayerValidWeapon(playerid, 17);
                        }
                        else {
                            SendClientMessage(playerid, COLOR_WHITE, "The government are unable to afford this weapon on your behalf.");
                        }
                    }
                    case 1: {
                        if(groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] >= 3000)
                        {
                            groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] -= 3000;
                            SendClientMessage(playerid, COLOR_WHITE, "You have withdrawn an M4A1. This has cost the government $3,000, so use it properly.");
                            givePlayerValidWeapon(playerid, 31);
                            PlayerPlaySound(playerid, 1052, 0, 0, 0);
                        }
                        else {
                            SendClientMessage(playerid, COLOR_WHITE, "The government are unable to afford this weapon on your behalf.");
                        }
                    }
                    case 2: {
                        if(groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] >= 5000)
                        {
                            groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] -= 5000;
                            SendClientMessage(playerid, COLOR_WHITE, "You have withdrawn a SPAS12. This has cost the government $5,000, so use it properly.");
                            givePlayerValidWeapon(playerid, 27);
                            PlayerPlaySound(playerid, 1052, 0, 0, 0);
                        }
                        else {
                            SendClientMessage(playerid, COLOR_WHITE, "The government are unable to afford this weapon on your behalf.");
                        }
                    }
                    case 3: {
                        if(groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] >= 5000) {
                            groupVariables[GOVERNMENT_GROUP_ID][gSafe][0] -= 5000;
                            SendClientMessage(playerid, COLOR_WHITE, "You have withdrawn a sniper rifle. This has cost the government $5,000, so use it properly.");
                            givePlayerValidWeapon(playerid, 34);
                            PlayerPlaySound(playerid, 1052, 0, 0, 0);
                        }
                        else {
                            SendClientMessage(playerid, COLOR_WHITE, "The government are unable to afford this weapon on your behalf.");
                        }
                    }
                }
            }
        case LSPD_DIALOG_EQUIPMENT1: {
            if(response) switch(listitem) {
                case 0: givePlayerValidWeapon(playerid, 3) && PlayerPlaySound(playerid, 1052, 0, 0, 0);
                case 1: givePlayerValidWeapon(playerid, 41) && PlayerPlaySound(playerid, 1052, 0, 0, 0);
                case 2: givePlayerValidWeapon(playerid, 24) && PlayerPlaySound(playerid, 1052, 0, 0, 0);
                case 3: givePlayerValidWeapon(playerid, 29) && PlayerPlaySound(playerid, 1052, 0, 0, 0);
                case 4: givePlayerValidWeapon(playerid, 25) && PlayerPlaySound(playerid, 1052, 0, 0, 0);
                case 5: SetPlayerArmour(playerid, 100.0) && PlayerPlaySound(playerid, 1052, 0, 0, 0);
            }
        }
        case DIALOG_LSPD: {
            if(response) switch(listitem) {
                    case 0: ShowPlayerDialog(playerid, DIALOG_LSPD_EQUIPMENT, DIALOG_STYLE_LIST, "Equipment", "Normal Equipment\nSWAT Equipment", "Select", "Cancel");
                    case 1: {
                        if(playerVariables[playerid][pGroupRank] >= 5) ShowPlayerDialog(playerid, DIALOG_LSPD_RELEASE, DIALOG_STYLE_INPUT, "Release Suspect", "Please enter the suspect's name.", "Proceed", "Cancel");
                        else SendClientMessage(playerid, COLOR_GREY, "You do not have the authority to do this.");
                    }
                    case 2: ShowPlayerDialog(playerid, DIALOG_LSPD_CLOTHING, DIALOG_STYLE_LIST, "Clothing", "Official Clothing\nCustom Selection", "Select", "Cancel");
                    case 3: {
                        if(playerVariables[playerid][pGroupRank] >= 5) ShowPlayerDialog(playerid, DIALOG_LSPD_CLEAR, DIALOG_STYLE_INPUT, "Clear Suspect", "Please enter the suspect's name.", "Proceed", "Cancel");
                        else SendClientMessage(playerid, COLOR_GREY, "You do not have the authority to do this.");
                    }
            }
        }

So err what am I doing wrong? ;/ Oh and there are my defines for the EMS dialog:

#define DIALOG_FDUTY (62)
#define DIALOG_EMS_CLOTHING (63)
#define DIALOG_EMS_CLOTHING_CUSTOM (64)
#define DIALOG_EMS_CLOTHING_OFFICIAL (65)
#define DIALOG_EMS_EQUIPMENT (66)
#define EMS_DIALOG_EQUIPMENT1 (67)
Reply
#2

?? How do we known what to fix for you? You haven't told us whats wrong or what errors you are getting ..
Reply
#3

Quote:
Originally Posted by [LoF]Zak
Посмотреть сообщение
?? How do we known what to fix for you? You haven't told us whats wrong or what errors you are getting ..
C:\Users\AlexMain\Desktop\forntcarsonrp\gamemodes\ fc-rp.pwn(7972) : error 017: undefined symbol "DIALOG_EMS_EQUIPMENT"
C:\Users\AlexMain\Desktop\forntcarsonrp\gamemodes\ fc-rp.pwn(7983) : warning 217: loose indentation
C:\Users\AlexMain\Desktop\forntcarsonrp\gamemodes\ fc-rp.pwn(7983) : error 014: invalid statement; not in switch
C:\Users\AlexMain\Desktop\forntcarsonrp\gamemodes\ fc-rp.pwn(7983) : warning 215: expression has no effect
C:\Users\AlexMain\Desktop\forntcarsonrp\gamemodes\ fc-rp.pwn(7983) : error 001: expected token: ";", but found ":"
C:\Users\AlexMain\Desktop\forntcarsonrp\gamemodes\ fc-rp.pwn(7983) : error 029: invalid expression, assumed zero
C:\Users\AlexMain\Desktop\forntcarsonrp\gamemodes\ fc-rp.pwn(7983) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.


Line 7972: case DIALOG_EMS_EQUIPMENT: {

Line 7983: case DIALOG_LOGIN: {

Line 7983 Has nothing to do with EMS dialog.
Reply
#4

bump?
Reply
#5

weird... No answer yet.
Reply
#6

The first thing you're doing wrong is that you put
Код:
#define EMS_DIALOG_EQUIPMENT1 (67)
at the top of your script, but you are using
pawn Код:
DIALOG_EMS_EQUIPMENT
in your dialog response.

================================================== ====

Second error is pretty much self explanatory. Don't know you could not figure that out. It means that the compiler expected ";" but found ":" so you change it!

Post line 7983.
Reply
#7

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
The first thing you're doing wrong is that you put
Код:
#define EMS_DIALOG_EQUIPMENT1 (67)
at the top of your script, but you are using
pawn Код:
DIALOG_EMS_EQUIPMENT
in your dialog response.

================================================== ====

Second error is pretty much self explanatory. Don't know you could not figure that out. It means that the compiler expected ";" but found ":" so you change it!

Post line 7983.
case DIALOG_LOGIN: {


Also something funny. if I delete a part of the wapons dialog I get 0 errors.
Reply
#8

Quote:
Originally Posted by Mark_Weston
Посмотреть сообщение
case DIALOG_LOGIN: {


Also something funny. if I delete a part of the wapons dialog I get 0 errors.
this sounds like your missing a bracket within your Weapon Dialog
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)