8 warning on dialog
#1

warning it was my first test on dialog so i don't know how fix it

Код:
E:\.............\.............\gamemodes\...pwn(4318) : warning 211: possibly unintended assignment
E:\.............\.............\gamemodes\...pwn(4336) : warning 211: possibly unintended assignment
E:\.............\.............\gamemodes\...pwn(4354) : warning 211: possibly unintended assignment
E:\.............\.............\gamemodes\...pwn(4371) : warning 211: possibly unintended assignment
E:\.............\.............\gamemodes\...pwn(4389) : warning 211: possibly unintended assignment
E:\.............\.............\gamemodes\...pwn(4407) : warning 211: possibly unintended assignment
E:\.............\.............\gamemodes\...pwn(4425) : warning 211: possibly unintended assignment
E:\.............\.............\gamemodes\...pwn(4443) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Warnings.
script
pawn Код:
if(dialogid == 5000) //VIP
    {
        if(response)
        {
            if(listitem == 0)
            {
                new string[128];
                new sendername[MAX_PLAYER_NAME];
                if(PlayerInfo[playerid][pVipTokens] == 0) //if player is off duty, set them them on
                {
                    SetPlayerHealth(playerid, 100);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "** %s fills their Health up.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            if(listitem == 1)
            {
                if(PlayerInfo[playerid][pVipTokens] > 2)
                    {
                            PlayerInfo[playerid][pVipTokens] -= 2;
                            new sendername[MAX_PLAYER_NAME];
                            SetPlayerArmour(playerid, 100);
                            new string[128];
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string, sizeof(string), "** %s fills their Vest up.", sendername);
                            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (2 Required).");
                    }
            }
            if(listitem == 2)
            {
                if(PlayerInfo[playerid][pVipTokens] > 2)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 2;
                        new sendername[MAX_PLAYER_NAME];
                        GivePlayerWeapon(playerid, 29, 999999);
                        PlayerInfo[playerid][pGun4] = 29;
                        new string[128];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs an MP5 from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (2 Required).");
                    }
            }
            if(listitem == 3)
            {
                if(PlayerInfo[playerid][pVipTokens] > 2)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 2;
                        GivePlayerWeapon(playerid, 25, 999999);
                        new sendername[MAX_PLAYER_NAME];
                        PlayerInfo[playerid][pGun3] = 25;
                        new string[128];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a Shotgun from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (2 Required).");
                    }
            }
            if(listitem == 4)
            {
                if(PlayerInfo[playerid][pVipTokens] > 6)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 6;
                        GivePlayerWeapon(playerid, 31, 999999);
                        new sendername[MAX_PLAYER_NAME];
                        PlayerInfo[playerid][pGun5] = 31;
                        new string[128];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs an M4 from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (6 Required).");
                    }
            }
            if(listitem == 5)
            {
                if(PlayerInfo[playerid][pVipTokens] > 6)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 6;
                        new sendername[MAX_PLAYER_NAME];
                        GivePlayerWeapon(playerid, 30, 999999);
                        new string[128];
                        PlayerInfo[playerid][pGun5] = 30;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs an AK-47 from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (6 Required).");
                    }
            }
            if(listitem == 6)
            {
                if(PlayerInfo[playerid][pVipTokens] > 4)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 4;
                        GivePlayerWeapon(playerid, 24, 999999);
                        PlayerInfo[playerid][pGun2] = 24;
                        new string[128];
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a Golden Deagle from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (4 Required).");
                    }
            }
            if(listitem = 7)
            {
                if(PlayerInfo[playerid][pVipTokens] > 8)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 8;
                        new string[128];
                        GivePlayerWeapon(playerid, 27, 999999);
                        PlayerInfo[playerid][pGun3] = 27;
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a SPAS-12 from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (8 Required).");
                    }
            }
            if(listitem = 8)
            {
            if(PlayerInfo[playerid][pVipTokens] > 8)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 8;
                        GivePlayerWeapon(playerid, 34, 999999);
                        new string[128];
                        new sendername[MAX_PLAYER_NAME];
                        PlayerInfo[playerid][pGun6] = 34;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a Sniper from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (8 Required).");
                    }
            }
            if(listitem = 9)
            {
                if(PlayerInfo[playerid][pVipTokens] > 2)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 2;
                        GivePlayerWeapon(playerid, 8, 999999);
                        new string[128];
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a Katana from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (2 Required).");
                    }
            }
            if(listitem = 10)
            {
                if(PlayerInfo[playerid][pVipTokens] > 1)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 1;
                        GivePlayerWeapon(playerid, 7, 999999);
                        new sendername[MAX_PLAYER_NAME];
                        new string[128];
                        PlayerInfo[playerid][pGun1] = 7;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a Pool Cue from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (1 Required).");
                    }
            }
            if(listitem = 11)
            {
                if(PlayerInfo[playerid][pVipTokens] > 1)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 1;
                        GivePlayerWeapon(playerid, 6, 999999);
                        new sendername[MAX_PLAYER_NAME];
                        new string[128];
                        PlayerInfo[playerid][pGun1] = 6;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a Shovel from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (1 Required).");
                    }
            }
            if(listitem = 12)
            {
                if(PlayerInfo[playerid][pVipTokens] > 1)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 1;
                        new sendername[MAX_PLAYER_NAME];
                        new string[128];
                        GivePlayerWeapon(playerid, 5, 999999);
                        PlayerInfo[playerid][pGun1] = 5;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a Baseball Bat from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (1 Required).");
                    }
            }
            if(listitem = 13)
            {
                if(PlayerInfo[playerid][pVipTokens] > 1)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 1;
                        new sendername[MAX_PLAYER_NAME];
                        new string[128];
                        GivePlayerWeapon(playerid, 2, 999999);
                        PlayerInfo[playerid][pGun1] = 2;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a Golf Club from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (1 Required).");
                    }
            }
            if(listitem = 14)
            {
                if(PlayerInfo[playerid][pVipTokens] > 1)
                    {
                        PlayerInfo[playerid][pVipTokens] -= 1;
                        GivePlayerWeapon(playerid, 1, 999999);
                        new sendername[MAX_PLAYER_NAME];
                        new string[128];
                        PlayerInfo[playerid][pGun0] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "** %s grabs a Brass Knuckles Set from the VIP Locker.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    }
                else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have enough VIP Tokens (1 Required).");
                    }
            }
        }
    }
and its not work good im select first one but it show all
pawn Код:
ShowPlayerDialog(playerid,5000,DIALOG_STYLE_LIST,"{E0321B}Vip Locker","Full Health: (Free)\r\nFull Vest: (2 Tokens)\r\nMP5: (2 Tokens)\r\nShotgun: (2 Tokens)\r\nM4: (6 Tokens)\r\nAK-47: (6 Tokens)\r\nDeagle: (4 Tokens)\r\nSPAS-12: (8 Tokens)\r\nSniper: (8 Tokens)\r\nKatana Sword: (2 Tokens)\r\nPool Cue: (1 Token)\r\nShovel: (1 Token)\r\nBaseball Bat: (1 Token)\r\nGolf Club: (1 Token)\r\nBrass Knuckles: (1 Token)","Ok", "Close");
Reply
#2

The thing I can see is that listitem 7-14 only has on‌e = instead of 2 ==
Reply
#3

what im do for fix it ?
Reply
#4

Change the if(listitem = to if(listitem ==
Reply
#5

Work Thanks For Help
Reply
#6

Quote:
Originally Posted by venice
Посмотреть сообщение
Work Thanks For Help
You should also change the > to >= otherwise if they have 8 tokens and try to get a sniper it'll say they don't have enough.

>= equals above or equal
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)