SA-MP Forums Archive
[Ajuda] Erros ao compilar mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Erros ao compilar mysql (/showthread.php?tid=467051)



Erros ao compilar mysql - Caio_Freeze - 30.09.2013

estou com esses erro que nгo consigo resolver

pawn Код:
C:\Users\Fernando\Desktop\Nova pasta\gamemodes\GM-GANG.pwn(1727) : error 035: argument type mismatch (argument 3)
C:\Users\Fernando\Desktop\Nova pasta\gamemodes\GM-GANG.pwn(1737) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Linha 1727:
pawn Код:
date = Time:cache_get_field_content(0, "date", xConexao);
linha 1737:
pawn Код:
expire = Time:cache_get_field_content(0, "expire", xConexao);



Re: Erros ao compilar mysql - arakuta - 01.10.2013

pawn Код:
cache_get_field_content(row,field[],destination[],handle);



Re: Erros ao compilar mysql - Caio_Freeze - 01.10.2013

Quote:
Originally Posted by arakuta
Посмотреть сообщение
pawn Код:
cache_get_field_content(row,field[],destination[],handle);
nгo adiantou acho que estou fazendo algo errado


Re: Erros ao compilar mysql - arakuta - 01.10.2013

Quote:
Originally Posted by Caio_Freeze
Посмотреть сообщение
nгo adiantou acho que estou fazendo algo errado
A funзгo tem 4 parвmetros. O ъltimo й handle=1, й opcional por isso nгo deu erro que falta parвmetros, mas deu erro que falta algo no o argumento 3. O que falta й ele ser uma STRING nгo uma integer, no caso destination[].

Jб lhe disse como deve utilizar a funзгo.

@edit

A funзгo cache_get_field_content nгo retorna nada, portanto vocк tambйm nгo pode igualar a alguma coisa.

A forma correta й vocк passar o valor do campo para o destino e entгo transformar o destino em integer, utilizando strval.

pawn Код:
new minhavar = strval("1234");



Re: Erros ao compilar mysql - Locky_ - 01.10.2013

Quote:
Originally Posted by arakuta
Посмотреть сообщение
pawn Код:
cache_get_field_content(row,field[],destination[],handle);
Usa o que o fera passou rapaz... Como usar
pawn Код:
new temp[50];
cache_get_field_content(0,"Coluna",temp,conexaoMySQL);
SuaVariavel = strval(temp);



Re: Erros ao compilar mysql - Caio_Freeze - 01.10.2013

olha o codigo inteiro
pawn Код:
public r@Ban_Check(playerid)
{
   new rows, fields;
   cache_get_data(rows, fields, xConexao);

   if (rows)
   {
      SendClientMessage(playerid, -1, "Foram encontrados registros ativos de ban em sua conta.");
      SendClientMessage(playerid, -1, "Verifique as ocorrкncias e busque uma revisгo caso necessбrio.");

      new admin[25], reason[64], Time:date,Time:expire,tm<tmTime>;

      cache_get_field_content(0, "admin", admin, xConexao);
      cache_get_field_content(0, "reason", reason, xConexao);

      date = Time:cache_get_field_content(0, "date", xConexao);
      localtime(Time:date,tmTime);
      strftime(gstring, sizeof gstring, "%d/%m/%Y аs %X", tmTime);

      format(gstring, sizeof gstring, "%s, aplicado pelo administrador %s.", gstring, admin);
      SendClientMessage(playerid, -1, gstring);

      format(gstring, sizeof gstring, "Motivo: %s", reason);
      SendClientMessage(playerid, -1, gstring);

      expire = Time:cache_get_field_content(0, "expire", expire, xConexao);
      if (_:expire != -1)
      {
         localtime(Time: expire,tmTime);
         strftime(gstring, sizeof gstring, "%d/%m/%Y аs %X", tmTime);

         format(gstring, sizeof gstring, "Expira em %s", gstring);
         SendClientMessage(playerid, -1, gstring);
      }
      else
      {
         SendClientMessage(playerid, -1, "Nгo hб um prazo determinado para expirar.");
      }
     
        Kick(playerid);
   }
   else
   {
      SendClientMessage(playerid, -1, "Nenhum registro encontrado, tenha um bom jogo!");

      TogglePlayerSpectating(playerid, false);
      //SpawnPlayer(playerid);
   }
   return true;
}



Re: Erros ao compilar mysql - zPain - 01.10.2013

pawn Код:
cache_get_field_content(0, "date", gstring, xConexao);
date = Time:strval(gstring);

cache_get_field_content(0, "expire", gstring, xConexao);
expire = Time:strval(gstring);



Re: Erros ao compilar mysql - Caio_Freeze - 01.10.2013

Quote:
Originally Posted by zPain
Посмотреть сообщение
pawn Код:
cache_get_field_content(0, "date", gstring, xConexao);
date = Time:strval(gstring);

cache_get_field_content(0, "expire", gstring, xConexao);
expire = Time:strval(gstring);
compilou sem erros vlw +rep


Re: Erros ao compilar mysql - zPain - 01.10.2013

Na funзгo localtime, jб que as variбveis date e expire foram declaradas com a tag Time, nгo hб necessidade de especificar.


pawn Код:
localtime(date, tmTime);
localtime(expire, tmTime);



Re: Erros ao compilar mysql - Caio_Freeze - 01.10.2013

Quote:
Originally Posted by zPain
Посмотреть сообщение
Na funзгo localtime, jб que as variбveis date e expire foram declaradas com a tag Time, nгo hб necessidade de especificar.


pawn Код:
localtime(date, tmTime);
localtime(expire, tmTime);
tendeu, obrigado novamente