Dialog Problem
#1

NVM Ty
Reply
#2

Give this a try
pawn Код:
if(dialogid == EXCHANGECRATES)
    {
        if(!response) return 1;
        if(PlayerInfo[playerid][pGunCrates] == 0)
        {
            SendClientMessageEx(playerid, COLOR_GREY, "You do not have any Gun Crates!.");
            return 1;
        }
        switch( listitem )
        {
            case 0:
            {
                if(PlayerInfo[playerid][pGunCrates] < 1)
                {
                    SendClientMessageEx(playerid, COLOR_YELLOW, "You do not have enough GunCrates for this.");
                    return 1;
                }
                else
                {
                    PlayerInfo[playerid][pGunCrates] -= 1;
                    format(string, sizeof(string), "You have traded 1 GunCrates for a Desert Eagle, you now have %d GunCrates(s).", PlayerInfo[playerid][pGunCrates]);
                    SendClientMessageEx(playerid, COLOR_YELLOW, string);
                }
                GivePlayerValidWeapon(playerid, 24, 60000);
            }
            case 1:
            {
                if(PlayerInfo[playerid][pGunCrates] >= 2)
                {
                    PlayerInfo[playerid][pGunCrates] -= 2;
                    format(string, sizeof(string), "You have traded 2 GunCrates for a SPAS-12, you now have %d GunCrates(s).", PlayerInfo[playerid][pGunCrates]);
                    SendClientMessageEx(playerid, COLOR_YELLOW, string);
                }
                else
                {
                    SendClientMessageEx(playerid, COLOR_YELLOW, "You do not have enough GunCrates for this.");
                    return 1;
                }
                GivePlayerValidWeapon(playerid, 27, 60000);
            }
            case 2:
            {
                if(PlayerInfo[playerid][pGunCrates] < 2)
                {
                    SendClientMessageEx(playerid, COLOR_YELLOW, "You do not have enough GunCrates for this.");
                    return 1;
                }
                else
                {
                    PlayerInfo[playerid][pGunCrates] -= 2;
                    format(string, sizeof(string), "You have traded 2 GunCrates for an M4, you now have %d GunCrates(s).", PlayerInfo[playerid][pGunCrates]);
                    SendClientMessageEx(playerid, COLOR_YELLOW, string);
                }
                GivePlayerValidWeapon(playerid, 31, 60000);
            }
            case 3:
            {
                if(PlayerInfo[playerid][pGunCrates] < 2)
                {
                    SendClientMessageEx(playerid, COLOR_YELLOW, "You do not have enough GunCrates for this.");
                    return 1;
                }
                else
                {
                    PlayerInfo[playerid][pGunCrates] -= 2;
                    format(string, sizeof(string), "You have traded 2 GunCrates for an AK-47, you now have %d GunCrates(s).", PlayerInfo[playerid][pGunCrates]);
                    SendClientMessageEx(playerid, COLOR_YELLOW, string);
                }
                GivePlayerValidWeapon(playerid, 30, 60000);
            }
            case 4:
            {
                if(PlayerInfo[playerid][pGunCrates] > 3)
                {
                    PlayerInfo[playerid][pGunCrates] -= 3;
                    format(string, sizeof(string), "You have traded 3 GunCrates for a sniper rifle, you now have %d GunCrates(s).", PlayerInfo[playerid][pGunCrates]);
                    SendClientMessageEx(playerid, COLOR_YELLOW, string);
                }
                else
                {
                    SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You do not have enough GunCrates for this.");
                    return 1;
                }
                GivePlayerValidWeapon(playerid, 34, 60000);
            }
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)