[Ajuda]Comando depositar e sacar em dialog
#1

Eu nгo consigo colocar os comandos "Depositar" e "Sacar" em dialog,se alguйm puder colocar eles pra mim ou me ensinar ficaria agradecido



pawn Код:
if(strcmp(cmd, "/depositar", true) == 0) {
format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
new checknome;
new tmp[256];
checknome = CPS_GetPlayerCheckpoint(playerid);
    if(checknome == caixaeletronico1 || checknome == caixaeletronico2 || checknome == caixaeletronico3 || checknome == caixaeletronico4 || checknome == caixaeletronico5 || checknome == caixaeletronico6 || checknome == caixaeletronico7 || checknome == caixaeletronico8
|| checknome == bancoPref){

   tmp = strtok(cmdtext, idx);
   if(!strlen(tmp)) {
   SendClientMessage(playerid, Vermelho, "Use /depositar [quantia].");
   }
            new valor;
   valor = strval(tmp);
            new aname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
   if(dini_Int(file, "ContaBancaria") == 1){
            new grana;
            grana = GetPlayerGrana(playerid);
            if(grana > valor-1 && valor > 0){
            format(string, sizeof(string), "(INFO) Bancos BNL: Vocк depositou a quantia de R$:%d.", valor);
            SendClientMessage(playerid, Verde, string);
            dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+valor);
            GivePlayerGrana(playerid, -valor);
            return 1;
            } else {
            SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem todo este dinheiro.");
            }

   } else {
        SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem uma conta bancбria.");
   }
   } else {
            SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб em um Banco.");
   }
  }

        if(strcmp(cmd, "/sacar", true) == 0) {
        format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
        new checknome;
        new tmp[256];
        checknome = CPS_GetPlayerCheckpoint(playerid);
        if(checknome == caixaeletronico1 || checknome == caixaeletronico2 || checknome == caixaeletronico3 || checknome == caixaeletronico4 || checknome == caixaeletronico5 || checknome == caixaeletronico6 || checknome == caixaeletronico7 || checknome == caixaeletronico8
        || checknome == bancoPref){
   tmp = strtok(cmdtext, idx);
   if(!strlen(tmp)) {
   SendClientMessage(playerid, Vermelho, "Use /sacar [quantia].");
   }
            new valor;
            valor = strval(tmp);
            new aname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
   if(dini_Int(file, "ContaBancaria") == 1){
            if(dini_Int(file, "SaldoBancario") > valor-1){
            format(string, sizeof(string), "(INFO) Bancos BNL: Vocк sacou a quantia de R$%d.", valor);
            SendClientMessage(playerid, Verde, string);
            dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")-valor);
            GivePlayerGrana(playerid, valor);
      return 1;
            } else {
            SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem todo este dinheiro.");
            }

   } else {
        SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem uma conta bancбria.");
   }
   } else {
            SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб em um Banco.");
   }
  }
Reply
#2

tente esse tuto do speliarmos..
https://sampforum.blast.hk/showthread.php?tid=119297
Reply
#3

Ola

Ve o que o cara disse acima

PT
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)