[Duvida] Dialog
#1

como botar esse cmd em dialog?

na caixinha para depositar
pawn Код:
CMD:deposit(playerid, params[]) {

    new
        cash,
        string[128];

    if(sscanf(params, "d", cash)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/deposit [amount]");
    else if(cash <= 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid amount specified.");
    else {
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 2306.8481,-16.0682,26.7496) && GetPlayerVirtualWorld(playerid) == 2) {
            if(playerVariables[playerid][pMoney] < cash) SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for this transaction.");
            else if(cash >= 1) {
                playerVariables[playerid][pBankMoney] += cash;
                playerVariables[playerid][pMoney] -= cash;
                format(string, sizeof(string), "You have deposited $%d into your bank account. Your account balance is now $%d.", cash, playerVariables[playerid][pBankMoney]);
                SendClientMessage(playerid, COLOR_DCHAT, string);
            }
            else SendClientMessage(playerid, COLOR_GREY, "Invalid amount specified.");
        }
        else {
            SendClientMessage(playerid, COLOR_GREY, "You're not at the bank.");
        }
    }
    return 1;
}
Reply
#2

Tenta assim.
Comando:
pawn Код:
CMD:deposit(playerid, params[])
{
  ShowPlayerDialog(playerid, ID, DIALOG_STYLE_INPUT,"Depositando","Digite o valor que deseja depositar","Depositar","Cancelar");//troca o ID por um numero q nao esteja sendo usado como id de dialog
  return 1;
}
Em OnDialogResponse:
pawn Код:
if(dialogid == ID) //troca ID pelo numero q colocou no ShowPlayerDialog
{
   if(!response) return SendClientMessage(playerid,-1,"Vocк cancelou o depуsito.");
   if(!strval(inputtext)) return  ShowPlayerDialog(playerid, ID, DIALOG_STYLE_INPUT,"Depositando","Digite o valor que deseja depositar (apenas numeros)","Depositar","Cancelar");//mesmo id dos outros, pois й o mesmo dialog
   if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid,-1,"Vocк й tгo pobre q nгo tem nem 1 real pra depositar kkkkk");
   new grana = strval(inputtext);
   if(grana < 1) return  ShowPlayerDialog(playerid, ID, DIALOG_STYLE_INPUT,"Depositando","O valor tem que ser maior ou igual a 1, pгo duro","Depositar","Cancelar");//mesmo id dos outros, pois й o mesmo dialog
   if(!IsPlayerInRangeOfPoint(playerid, 15.0, 2306.8481,-16.0682,26.7496) && GetPlayerVirtualWorld(playerid) != 2) return SendClientMessage(playerid,-1,"Vocк nгo estб no banco.");
   if(playerVariables[playerid][pMoney] < grana) SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for this transaction.");
   playerVariables[playerid][pBankMoney] += grana;
   playerVariables[playerid][pMoney] -= grana;
   format(string, sizeof(string), "You have deposited $%d into your bank account. Your account balance is now $%d.", grana, playerVariables[playerid][pBankMoney]);
   SendClientMessage(playerid, COLOR_DCHAT, string);
   return 1;
}
acho q dб, tenta ae
Reply
#3

-----"
BUG da para depositar 100000000000000000000000000000000000
Reply
#4

@CloseD

comecei a ler sobre e conssegui fazer um sem bug

obrigado msm assim
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)