[Ajuda]Bancos
#1

tem um bug no dinheiro
no comando sacar quero proibir sacar valores negativos

Код:
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){
        tmp = strtok(cmdtext, idx);
   if(!strlen(tmp)) {
   SendClientMessage(playerid, Vermelho, "Use /sacar [quantia].");
   }
   if (strfind(inputtext, "-") != -1) return SendClientMessage(playerid, Blue, "[BANCO] Vocк nгo pode sacar valores negativos!");
            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 BMR RPG: 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.");
   }
  }
qd eu tento ele
da esse erro

Код:
C:\Documents and Settings\SAMP-SERVER\Desktop\coisas de servidor\samp03csvr_win32\pawno\mucanatal2.pwn(6476) : error 017: undefined symbol "inputtext"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

pawn Код:
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){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
   SendClientMessage(playerid, Vermelho, "Use /sacar [quantia].");
}
if(strfind(tmp, "-", true) != -1)
{
     SendClientMessage(playerid,Vermelho,"(ERRO) Valor invбlido!");
     return 1;
}
            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 BMR RPG: 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.");
   }
  }
Tente isso acho que vai resolver (seu cуdigo nгo estб indentado)
Flw saindo aqui fuis.
Reply
#3

inputtext vocк deve usar somente em -> OnDialogResponse <-
Este erro й ocasionado justamente por isso. pois em OnPlayerCommandText, nгo contйm o parвmetro inputtext.

Para proibir sacar negativo basta acrescentar isso:

pawn Код:
if(dini_Int(file, "ContaBancaria") - valor) <= 0 return SendClientMessage(playerid, 0xFFFFFFAA, " Quantidade invalida. O resultado nao deve ser negativo);
Reply
#4

GM do The Crimes, tenso. Nesse GM jб tem o bang de nгo sacar valor negativo.
Reply
#5

Em quase todos os gm's que tem banco tem essa funзгo.
Reply
#6

Quote:
Originally Posted by Pedro Vicentini
Посмотреть сообщение
GM do The Crimes, tenso. Nesse GM jб tem o bang de nгo sacar valor negativo.
Esse code й do GameMode do Muca eu acho, porque o se fosse o do TC foi arrumado pelo Diego.
Reply
#7

Quote:
Originally Posted by [RoxX]Ygor
Посмотреть сообщение
Esse code й do GameMode do Muca eu acho, porque o se fosse o do TC foi arrumado pelo Diego.
E o GameMode do Muca foi de que GameMode ? Do TC. E eu fiquei sabendo que o Diego se envolveu nas drogas, e excluiu tudo do samp... Quando ele postou o gm no orkut, todos baixaram e fizeram servidor com ele.
Reply
#8

inputtext deve ser usado apenas em dialogs.
O Falcon jб postou a soluзгo, nada mais a dizer (:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)