12.05.2017, 22:21
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;
}