Command in dialog
#1

Can someone help me to transform this command in a dialog?

pawn Код:
CMD:deposit(playerid, params[])
{
    new string[96], string2[96];
    new type;
    if(sscanf(params, "d", type)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /deposit [amount]");
    if(type <= 0) return SendClientMessage(playerid, COLOR_RED, "* Amount must be greater than zero.");
    if(GetPlayerMoney(playerid) >= type)
    {
        GivePlayerMoney(playerid, -type);
        Player[playerid][Bank] += type;
        Player[playerid][TotalBankDeposited] += type;
        format(string, sizeof(string), "* You have successfully deposited "GREEN"%d$ "WHITE"to your bank account.", type);
        format(string2, sizeof(string2), "* New bank account balance: "GREEN"%d$", Player[playerid][Bank]);
        SendClientMessage(playerid, -1, string);
        SendClientMessage(playerid, -1, string2);
    }
    else SendClientMessage(playerid, COLOR_RED, "* You do not have that much amount in your pocket.");
    return 1;
}
Reply
#2

https://sampwiki.blast.hk/wiki/ShowPlayerDialog

Pack the second string in the first one and separate them with a new line ( \n), replace the SendClientMessage function for the ShowPlayerDialog function shown above using the given parameters.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)