Dialog problem
#3

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmd, "/buylicense", true) == 0)
    {
      if(IsPlayerConnected(playerid) && PlayerToPoint(2.0, playerid, 361.8299,173.6302,1008.3828))
    {
            TogglePlayerControllable(playerid, 0);
            ShowPlayerDialog(playerid, LICMENU, DIALOG_STYLE_LIST, "Odaberi Licencu","Voznja $2000\nLetenje $5000\nPlovidba $800\nOruzje $8000", "Kupi", "Cancel");
        return 1;
    }
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == LICMENU)
    {
        if(response)
        {
            if(listitem == 0) // Car Liceses
            {
         if (PlayerInfo[playerid][pCarLic] == 0 && GetPlayerMoney(playerid) > 49)
                 {
            GivePlayerMoney(playerid,-2000);
            PlayerInfo[playerid][pCarLic] = 1;
                SendClientMessage(playerid, COLOR_GREEN, " Kupio si vozacku dozvolu!");
                    SendClientMessage(playerid, COLOR_GRAD5, " Mozes provijeriti licence ako upises /licenses !");
                    TogglePlayerControllable(playerid, 1);
                    return 1;
                 }
                 else
                 {
            SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
            TogglePlayerControllable(playerid, 1);
           }
            }
            if(listitem == 1) // Flying Licenses
            {
           if (GetPlayerMoney(playerid) > 4999)
                 {
            GivePlayerMoney(playerid,-5000);
                    PlayerInfo[playerid][pFlyLic] = 1;
                    SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za Letenje!");
                SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
                TogglePlayerControllable(playerid, 1);
                    return 1;
                 }
                 else
                 {
            SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
            TogglePlayerControllable(playerid, 1);
           }
            }
            if(listitem == 2) // Sail Licenses
            {
           if (GetPlayerMoney(playerid) > 799)
                 {
            GivePlayerMoney(playerid,-800);
                    PlayerInfo[playerid][pBoatLic] = 1;
                    SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za brod!");
                SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
                TogglePlayerControllable(playerid, 1);
                    return 1;
                 }
                 else
                 {
            SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
            TogglePlayerControllable(playerid, 1);
           }
            }
            if(listitem == 3) // Gun licenses
            {
            if (GetPlayerMoney(playerid) > 799)
                {
            GivePlayerMoney(playerid,-8000);
                PlayerInfo[playerid][pGunLic] = 1;
                SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za oruzje!");
            SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
            TogglePlayerControllable(playerid, 1);
                return 1;
                }
                else
                {
                SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
                TogglePlayerControllable(playerid, 1);
                }
      }
        }
        return 1;
}
It should work now.. (not tested.)
Reply


Messages In This Thread
Dialog problem - by Matej682 - 27.02.2010, 17:39
Re: Dialog problem - by Matej682 - 27.02.2010, 19:42
Re: Dialog problem - by Fedee! - 27.02.2010, 19:47
Re: Dialog problem - by GTAguillaume - 27.02.2010, 19:50
Re: Dialog problem - by Fedee! - 27.02.2010, 19:54
Re: Dialog problem - by Matej682 - 28.02.2010, 09:21
Re: Dialog problem - by Matej682 - 28.02.2010, 13:33
Re: Dialog problem - by MaykoX - 28.02.2010, 13:36
Re: Dialog problem - by Matej682 - 28.02.2010, 14:02
Re: Dialog problem - by Niixie - 28.02.2010, 14:07
Re: Dialog problem - by Matej682 - 28.02.2010, 14:41
Re: Dialog problem - by kmzr - 28.02.2010, 14:57
Re: Dialog problem - by Matej682 - 28.02.2010, 15:08
Re: Dialog problem - by DarkPower - 28.02.2010, 15:09
Re: Dialog problem - by kmzr - 28.02.2010, 15:12
Re: Dialog problem - by DarkPower - 28.02.2010, 15:16
Re: Dialog problem - by Matej682 - 28.02.2010, 15:25
Re: Dialog problem - by Fedee! - 28.02.2010, 15:27
Re: Dialog problem - by Sharks - 28.02.2010, 15:30

Forum Jump:


Users browsing this thread: 1 Guest(s)