[Ajuda] Comando invalido
#1

Preciso de uma ajuda com 2 comandos.
Quando agente digita eles aparece Comando Invalido.
Ex:
pawn Код:
(ERRO) Vocк nгo estб em um Banco.
/sacar 10 . Comando Invalido.
Mas quando o player esta no checkpoint do banco nao aparece isso.

Aki estao os Comandos:
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 == caixaeletronico3 || checknome == caixaeletronico5 || checknome == caixaeletronico7 || 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) Caixa Rapido: 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 == caixaeletronico3 || checknome == caixaeletronico5 || checknome == caixaeletronico7 || checknome == bancoPref){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Use /sacar [quantia].");
return 1;
}
new valor;
if(strfind(tmp, "-", true) != -1)
{
SendClientMessage(playerid,Vermelho,"(ERRO) Valor invбlido!");
return 1;
}
if(strlen(tmp) > 8)
{
SendClientMessage(playerid, Vermelho, "(ERRO) Valor invбlido!");
return 1;
}
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 Brasil Vida Online: 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


Forum Jump:


Users browsing this thread: 1 Guest(s)