SA-MP Forums Archive
Command in dialog - 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: Command in dialog (/showthread.php?tid=634081)



Command in dialog - Despacito - 12.05.2017

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;
}



Re: Command in dialog - Toroi - 12.05.2017

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.