SA-MP Forums Archive
[Dialog] - Question some problem. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Dialog] - Question some problem. (/showthread.php?tid=337030)



[Dialog] - Question some problem. - GBLTeam - 24.04.2012

Hello all, i was putting one command in dialog for licenses.

But i got one problem everything other is okay but only this makes problem when you buy the first license and then
try again to buy it its okay says "You have this license" but if you try to buy the other license and then try to buy it again says nothing?


pawn Код:
if(dialogid == PDLICENCI)
    {
        if(response)
           {
            if(listitem == 0)
            {
            if(PlayerInfo[playerid][pGunLic] == 0)
            {
            SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Kupili ste dozvolu za oruzje za {00B9FF}$5000");
            SafeGivePlayerMoney(playerid, - 5000);
            PlayerInfo[playerid][pGunLic] = 1;
            OnPlayerUpdateCustom(playerid);
            }
            else
            {
            SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Ti veke imas kupeno {00B9FF}licenca.");
            return 1;
            }
            if(listitem == 1)
            {
            if(PlayerInfo[playerid][pFishLic] == 0)
            {
            SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Kupili ste dozovlu za ribolov za {00B9FF}$2000");
            SafeGivePlayerMoney(playerid, - 2000);
            PlayerInfo[playerid][pFishLic] = 1;
            OnPlayerUpdateCustom(playerid);
            }
            else
            {
            SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Ti veke imas kupeno {00B9FF}licenca.");
            return 1;
       }

    }
   }
 }
}



Re: [Dialog] - Question some problem. - ViniBorn - 24.04.2012

No apparent problem ...
pawn Код:
if(dialogid == PDLICENCI)
{
    if(response)
    {
        switch(listitem
        {
            case 0:
            {
                if(PlayerInfo[playerid][pGunLic] == 0)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Kupili ste dozvolu za oruzje za {00B9FF}$5000");
                    SafeGivePlayerMoney(playerid, - 5000);
                    PlayerInfo[playerid][pGunLic] = 1;
                    OnPlayerUpdateCustom(playerid);
                }
                else
                    return SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Ti veke imas kupeno {00B9FF}licenca.");
            }
            case 1:
            {
                if(PlayerInfo[playerid][pFishLic] == 0)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Kupili ste dozovlu za ribolov za {00B9FF}$2000");
                    SafeGivePlayerMoney(playerid, - 2000);
                    PlayerInfo[playerid][pFishLic] = 1;
                    OnPlayerUpdateCustom(playerid);
                }
                else
                    return SendClientMessage(playerid, COLOR_WHITE, "[{FFD200}INFO{FAFAFA}]: Ti veke imas kupeno {00B9FF}licenca.");
            }
        }
    }
}