[DUV] muitos erros todos iguais
#1

olha esses aki sгo os erros
gostaria que alguem me ajudasse
Code:
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12660) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12665) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12671) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12676) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12686) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12705) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12715) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12724) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12730) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12741) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12752) : error 079: inconsistent return types (array & non-array)
C:\SAMP\Mode Teste\_gamemodes_BLC.pwn(12765) : error 079: inconsistent return types (array & non-array)

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
esses erros sгo no thug pq eu estou usando ele pra testar coisas novas como login box e tals
antes de colocar no outro gm
Reply
#2

manda as linhas dos erros para ver se alguem pode ajudar ._.
Reply
#3

Isso acontece quando vc tem uma funзгo que retorna "Tipos" diferentes de respostas.

Exemplo:

pawn Code:
stock PlayerName(playerid){
  if(IsPlayerConnected(playerid)){
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    return pname;
  }
  return false;
}
Essa funзгo vai dar este erro pq ela retorna uma String ( "texto" ) e um Boolean ( false / true ). o certo seria:

pawn Code:
stock PlayerName(playerid){
  new pname[MAX_PLAYER_NAME];
  if(IsPlayerConnected(playerid)){
    GetPlayerName(playerid,pname,sizeof(pname));
  }
  return pname;
}
(no caso nem precisa usar IsPlayerConnected, soh usei de exemplo)
Reply
#4

Quote:
Originally Posted by wafffllesss
Isso acontece quando vc tem uma funзгo que retorna "Tipos" diferentes de respostas.

Exemplo:

pawn Code:
stock PlayerName(playerid){
  if(IsPlayerConnected(playerid)){
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    return pname;
  }
  return false;
}
Essa funзгo vai dar este erro pq ela retorna uma String ( "texto" ) e um Boolean ( false / true ). o certo seria:

pawn Code:
stock PlayerName(playerid){
  new pname[MAX_PLAYER_NAME];
  if(IsPlayerConnected(playerid)){
    GetPlayerName(playerid,pname,sizeof(pname));
  }
  return pname;
}
(no caso nem precisa usar IsPlayerConnected, soh usei de exemplo)
mais acho que nгo entendi
vocк quer dizer que eu posso estar usando
a mesma funзгo com diferentes nomes
Reply
#5

Nгo, eu digo que vocк esta retornando em uma funзгo respostas de TIPOS diferentes.

na Funзгo vocк sу pode retornar um tipo de resposta.

- Um numero inteiro.
- Um numero flutuante (float)
- Um STRING (texto)
- Um BOOLEAN (true / false ) verdadeiro ou falso.
... (se houver outros eu disconheзo ou nгo recordo)

Se voce mandar a funзгo ( mesmo que em areas diferentes ) retornar um tipo diferente do outro, ele te mostra esse erro.

como no meu exemplo:

pawn Code:
stock PlayerName(playerid){
  if(IsPlayerConnected(playerid)){
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    return pname; <- STRING
  }
  return false; <- BOOLEAN
}
Reply
#6

Quote:
Originally Posted by wafffllesss
Nгo, eu digo que vocк esta retornando em uma funзгo respostas de TIPOS diferentes.

na Funзгo vocк sу pode retornar um tipo de resposta.

- Um numero inteiro.
- Um numero flutuante (float)
- Um STRING (texto)
- Um BOOLEAN (true / false ) verdadeiro ou falso.
... (se houver outros eu disconheзo ou nгo recordo)

Se voce mandar a funзгo ( mesmo que em areas diferentes ) retornar um tipo diferente do outro, ele te mostra esse erro.

como no meu exemplo:

pawn Code:
stock PlayerName(playerid){
  if(IsPlayerConnected(playerid)){
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    return pname; <- STRING
  }
  return false; <- BOOLEAN
}
entгo vocк quer dizer que eu estou colocando as funзхes
de return
em locais errados
tipo
ex
//add la la l a (aqui e do numero 1)
eu eu coloco
return 2:

e isso?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)