OnDialogResponse Problem
#4

Try:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_LOGIN)
    {
        if(response == 1)
        {
            //strmid(tmppass, tmp, 0, strlen(cmdtext), 255); // Sorry don't know how its works onplayercommandtext, you didnt show all code so i change it to inputtext to get the text from dialog input
            //Encrypt(inputtext);
            OnPlayerLogin(playerid,inputtext);
        }
        else
        {
            if(IsPlayerNPC(playerid))return 1;
            Kick(playerid);
            SendClientMessage(playerid, COLOR_YELLOW, "Pai daca nu vrei ce cauti pe server?!");
        }
    }
    else if(dialogid == DIALOG_REGISTER)
    {
        if(response == 1)
        {
            //strmid(tmppass, tmp, 0, strlen(cmdtext), 255); // Sorry don't know how its works onplayercommandtext, you didnt show all code so i change it to inputtext to get the text from dialog input
            //Encrypt(inputtext);
            if(strlen(inputtext) < 2 /*|| strlen(inputtext) > MAX Characters*/)
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Parola trebuie sa aiba minim 2 caractere!");
                ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"Register:","|_______________________________________|\nDepartamentul de emigrari: Te rugam sa prezinti pasaportul.\n Scrie-ti parola dedesubt pentru a te inregistra","Register","Cancel");
            }
            else
            {
                OnPlayerRegister(playerid,inputtext);
            }
        }
        else
        {
            if(IsPlayerNPC(playerid))return 1;
            Kick(playerid);
            SendClientMessage(playerid, COLOR_YELLOW, "Pai daca nu vrei ce cauti pe server?!");
        }
    }
    else if(dialogid == 382)// bancomat extrage
    {
        if(response == 1)
        {
            if(!strlen(inputtext))
            {
                SendClientMessage(playerid,COLOR_GREY," Nu ati tastat suma !");
                return 1;
            }
            new cashdeposit = strval(inputtext);
            if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Nu aveti asa mult !");
                return 1;
            }
            //ConsumingMoney[playerid] = 1;
            new proc = (cashdeposit*5)/100;
            new bani = cashdeposit-proc;
            new string[500];
            SafeGivePlayerMoney(playerid,bani);
            PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-bani-proc;
            format(string, sizeof(string), "  Ati scos suma de %d RON din contul dumneavoastra. Total Cont: %d RON. Va multumim pentru ca ati folosit bancomatul!", bani,PlayerInfo[playerid][pAccount]);
            SendClientMessage(playerid, COLOR_YELLOW, string);
            BizzInfo[3][bTill] += proc;
            BizzInfo[4][bTill] += proc;
            BizzInfo[18][bTill] += proc;
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "Va multumim pentru ca ati folosit bancomatul!");
        }
    }
    return 1;
}
Reply


Messages In This Thread
OnDialogResponse Problem - by calin1996 - 28.05.2012, 17:34
Re: OnDialogResponse Problem - by CidadeNovaRP - 28.05.2012, 17:37
Re: OnDialogResponse Problem - by calin1996 - 28.05.2012, 17:45
Re: OnDialogResponse Problem - by CidadeNovaRP - 28.05.2012, 17:58
Re: OnDialogResponse Problem - by calin1996 - 28.05.2012, 18:18
Re: OnDialogResponse Problem - by calin1996 - 28.05.2012, 18:43
Re: OnDialogResponse Problem - by HuSs3n - 28.05.2012, 19:06
Re: OnDialogResponse Problem - by Legolas.W - 28.05.2012, 19:56
Re: OnDialogResponse Problem - by calin1996 - 29.05.2012, 10:55
Re: OnDialogResponse Problem - by calin1996 - 29.05.2012, 11:01

Forum Jump:


Users browsing this thread: 1 Guest(s)