Need help with a dialog
#1

Ok so,i made a class dialog that show everytime a player spawns.But there is a problem,when a dialogbox appear,if i press ESC,no option where selected from the dialog and i got normal cj skin.

How to fix this problem?

here is the dialog:

pawn Код:
if(dialogid == 888)
    {
        if(response)
        {
            if(listitem == 0)  // Assault
            {
               SetPlayerArmour(playerid, 90.0);
               GivePlayerWeapon(playerid, 24, 75);
               GivePlayerWeapon(playerid, 27, 50);
               GivePlayerWeapon(playerid, 31, 120);
               SetPlayerSkin(playerid, 124);
            }
            if(listitem == 1)  // Demolition
            {
            if(GetPlayerScore(playerid) < 500)
            {
                 SendClientMessage(playerid,0xFF0000AA,"You need 500 score for Demolition class.");
                 ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");
                 return 0;
            }
            else if(GetPlayerScore(playerid) > 500)
            {
               SetPlayerArmour(playerid, 90.0);
               GivePlayerWeapon(playerid, 35, 5);
               GivePlayerWeapon(playerid, 28, 150);
               GivePlayerWeapon(playerid, 16, 10);
               SetPlayerSkin(playerid, 179);
            }
            }
            if(listitem == 2)  // Expert
            {
            if(GetPlayerScore(playerid) < 1000)
            {
                 SendClientMessage(playerid,0xFF0000AA,"You need 1000 score for Expert class.");
                 ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");
                 return 0;
            }
            else if(GetPlayerScore(playerid) > 1500)
            {
               SetPlayerArmour(playerid, 90.0);
               GivePlayerWeapon(playerid, 26, 240);
               GivePlayerWeapon(playerid, 24, 75);
               GivePlayerWeapon(playerid, 17, 20);
               GivePlayerWeapon(playerid, 37, 150);
               SetPlayerSkin(playerid, 272);
            }
            }
              if(listitem == 3)  // Sniper
            {
            if(GetPlayerScore(playerid) < 100)
            {
                 SendClientMessage(playerid,0xFF0000AA,"You need 100 score for Sniper class.");
                 ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");
                 return 0;
            }
            else if(GetPlayerScore(playerid) > 100)
            {
               SetPlayerArmour(playerid, 90.0);
               GivePlayerWeapon(playerid, 34, 200);
               GivePlayerWeapon(playerid, 16, 20);
               SetPlayerSkin(playerid, 183);
            }
            }
                  if(listitem == 4)  // Damager
            {
            if(GetPlayerScore(playerid) < 100)
            {
                 SendClientMessage(playerid,0xFF0000AA,"You need 5000 score for Damager class.");
                 ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");
                 return 0;
            }
            else if(GetPlayerScore(playerid) > 5000)
            {
               SetPlayerArmour(playerid, 90.0);
               GivePlayerWeapon(playerid, 35, 100);
               SetPlayerSkin(playerid, 33);
            }
            }
        }
      return 1;
    }
OnPlayerSpawn:

pawn Код:
ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "******CLASS******", "Assault\nDemolition\nExpert\nSniper\nDamager", "Ok", "");
Thanks.
Reply


Messages In This Thread
Need help with a dialog - by Face9000 - 30.12.2011, 20:46
Re: Need help with a dialog - by AstonDA-G - 30.12.2011, 20:48
Re: Need help with a dialog - by Face9000 - 30.12.2011, 20:56
Re: Need help with a dialog - by AstonDA-G - 30.12.2011, 20:58
Re: Need help with a dialog - by Face9000 - 30.12.2011, 21:04
Re: Need help with a dialog - by AstonDA-G - 30.12.2011, 21:07
Re: Need help with a dialog - by AustinJ - 30.12.2011, 21:13
Re: Need help with a dialog - by Face9000 - 30.12.2011, 21:23

Forum Jump:


Users browsing this thread: 4 Guest(s)