SA-MP Forums Archive
[AJUDA] error 079: inconsistent return types (array & non-array) - 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] error 079: inconsistent return types (array & non-array) (/showthread.php?tid=336839)



[AJUDA] error 079: inconsistent return types (array & non-array) - Gabriel.GTATorcidas - 23.04.2012

Nгo sei o que houve, fiz uns teleports por dialog, e deu esses erros '-'

ERROS:
pawn Код:
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(249) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(255) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(256) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(264) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(267) : warning 217: loose indentation
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(270) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(271) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(279) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(291) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(295) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(298) : warning 225: unreachable code
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(298) : warning 217: loose indentation
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(303) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(307) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(321) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(323) : warning 217: loose indentation
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(326) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(331) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(336) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(343) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(348) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(355) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(362) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(370) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(375) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(414) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(419) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(457) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(462) : error 079: inconsistent return types (array & non-array)
C:\Users\gabriel\Desktop\PROJETO GM DE x1 GDG\Untitled.pwn(469) : error 079: inconsistent return types (array & non-array)

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
pawn Код:
//LINHA 243 atй 470

public OnPlayerCommandText(playerid, cmdtext[])
{

if(strcmp("/teles",cmdtext,true)==0)
{
    ShowPlayerDialog(playerid, 4545, DIALOG_STYLE_LIST, "Teleports", "Sede Oficial\nTerminal SF\nTerminal LV\nArena x1\nBar da Geral\nBaile Funk", "Selecionar", "Cancelar");
    return 1;
}

if(strfind(cmdtext, "/ir", true) == 0)
{
    if(cmdtext[3] == EOS || cmdtext[3] == 32) {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHOESCURO, "Vocк nгo tem permissгo para usar esse comando.");
        if(cmdtext[3] != 32 || (cmdtext[4] == 0 && cmdtext[3] == 32)) return SendClientMessage(playerid, AZULESCURO, "Digite: /ir [id do jogador]");
        new Float:P_Pos[3];
        new var;
        var = strval(cmdtext[4]);
        GetPlayerPos(var, P_Pos[0], P_Pos[1], P_Pos[2]);
        SetPlayerPos(playerid, P_Pos[0], P_Pos[1], P_Pos[2]);
        format(cmdtext, 128, "** Vocк foi atй a localizaзгo do ID %i.", var);
        SendClientMessage(playerid, CINZA, cmdtext);
        return 1;
    }

if(strfind(cmdtext, "/trazer", true) == 0)
{
    if(cmdtext[7] == EOS || cmdtext[7] == 32) {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHOESCURO, "Vocк nгo tem permissгo para usar esse comando.");
        if(cmdtext[7] != 32 || (cmdtext[8] == 0 && cmdtext[7] == 32)) return SendClientMessage(playerid, AZULESCURO, "Digite: /trazer [id do jogador]");
        new Float:P_Pos[3];
        new var;
        var = strval(cmdtext[8]);
        GetPlayerPos(playerid, P_Pos[0], P_Pos[1], P_Pos[2]);
        SetPlayerPos(var, P_Pos[0], P_Pos[1], P_Pos[2]);
        format(cmdtext, 128, "** Vocк trouxe o jogador ID %i para sua localizaзгo.", var);
        SendClientMessage(playerid, CINZA, cmdtext);
        return true;
    }
}

if(strcmp(cmdtext, "/dc", true) == 0)
{
    if(IsPlayerAdmin(playerid)) {
        new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
        DestroyVehicle(currentveh);
        SendClientMessage(playerid, AZUL,"Vocк deletou um veнculo.");
        return 1;
    }
    else {
        SendClientMessage(playerid, VERMELHOESCURO,"Vocк nгo tem permissгo para usar este comando.");
        return 1;
    }

if(strcmp("/veh",cmdtext,true)==0)
{
    if(IsPlayerAdmin(playerid)) {
        ShowPlayerDialog(playerid, 4546, DIALOG_STYLE_LIST, "Veiculos", "Infernus\nSultan\nNRG 500\nOnibus 1\nOnibus 2\nBike\nMountain Bike\nVortex\nAviгo\nHelicoptero", "Selecionar", "Cancelar");
        SendClientMessage(playerid, AZUL, "** Vocк criou um veнculo, mantenha o servidor limpo, apуs usб-lo delete-o. (/dc)");
        return 1;
    }
    else {
        SendClientMessage(playerid, VERMELHOESCURO,"Vocк nгo tem permissгo para usar este comando.");
        return 1;
    }
}
if (strcmp("/regras", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, ROSA, "** REGRAS **");
    SendClientMessage(playerid, VERDECLARO,"O server й para eventos, e filmagens, e no que pode ser ъtil;");
    SendClientMessage(playerid, VERDECLARO,"e ainda nгo possuн sistema de /SET, entгo os Orgs/Puxs ou Organizadores de um possнvel evento logarгo na Rcon p/ usar seus comandos;");
    SendClientMessage(playerid, VERDECLARO,"se vocк nгo й Org/Pux, ou nгo esta organizando um evento nгo terб a RCON, Nгo insista!");
    SendClientMessage(playerid, AZUL,"Quando um Organizador criar um evento, ele puxarб todos para o local;");
    SendClientMessage(playerid, AZUL,"caso tu nгo o obedecer, levarб KICK, se persistir BAN.");
    SendClientMessage(playerid, ROSA,"Nгo use qualquer tipo de Teleport para fugir de combate;");
    SendClientMessage(playerid, ROSA,"O Comando foi criado para diversгo, e diversгo tem hora certa, se virar bagunзa o comando serб retirado.");
    SendClientMessage(playerid, AZUL,"Dependendo do comportamento de vocкs referente ao /TELES, futuramente pode haver comandos de DeathMatch(/dm's)");
    return 1;
}
    if (strcmp("/comandosadmin", cmdtext, true, 10) == 0)
{
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"COMANDOS ADMIN","\t /EVENTOX1 - LEVA TODOS PRA ARENA X1\n\t /EVENTOBAR - LEVA TODOS PRO BAR\n\t /EVENTOESTADIO - LEVA TODOS P/ O TERMINAL PROXIMO AO ESTБDIO\n\t /VIDAT - SETA VIDA PARA TODOS\n\t /COLETET - SETA COLETE PARA TODOS\n\t /ARMAS - ABRE UM MENU DE ARMAS\n\t /JETPACK - CRIA UMA MOCHILA А JATO\n\t /DC - DELETA UM VEНCULO)","Ok","Voltar");
    return 1;
}
    if (strcmp("/comandos", cmdtext, true, 10) == 0)
{
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"COMANDOS","\t /TELES - Lista com Teleports\n\t /KILL - Para se Suicidar\n\t /LOJADEARMAS - Abre um Menu com Armas Brancas\n\t /ANIMLIST - Animaзхes\n\t /RADIO - Liga a Radio ","Ok","Voltar");
    return 1;
}
    if (strcmp("/kill", cmdtext, true, 10) == 0)
{
    SetPlayerHealth(playerid, 0);
    return 1;
    }
    if (strcmp("/armas", cmdtext, true, 10) == 0)
{
     if(IsPlayerAdmin(playerid))
     {
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Armas", "Ak-47\nM4\nMP5\nEagle\nFaca\nSerra Elйtrica\nSniper\nCombat Shotgun\nSpray\nExtintor\nVibrador", "Selecionar", "Voltar");
    return 1;
   }
     else
   {
    SendClientMessage(playerid, VERMELHOESCURO,"Vocк nгo tem permissгo para usar este comando.");
    return 1;
     }
}
    if(!strcmp(cmdtext, "/radio", true))
{
    PlayAudioStreamForPlayer(playerid,"http://37.59.160.242:9988");
    SendClientMessage(playerid, AZUL, "** Vocк ligou a Rбdio, para desligar digite /stopradio.");
    return 1;
}

    if(!strcmp(cmdtext, "/stopradio", true))
{
    StopAudioStreamForPlayer(playerid);
    SendClientMessage(playerid, VERMELHOESCURO, "** Vocк desligou a Rбdio.");
    return 1;
}
    if (strcmp("/jetpack", cmdtext, true, 10) == 0)
{
     if(IsPlayerAdmin(playerid))
     {
    SetPlayerSpecialAction(playerid,2);
    SendClientMessage(playerid, AZUL, "** Vocк criou um Jetpack.");
    return 1;
   }
     else
   {
    SendClientMessage(playerid, VERMELHOESCURO,"Vocк nгo tem permissгo para usar este comando.");
    return 1;
     }
}

    if (strcmp("/vidat", cmdtext, true, 10) == 0)
{
     if(IsPlayerAdmin(playerid))
     {
    SetPlayerHealth(0, 100);
    SetPlayerHealth(1, 100);
    SetPlayerHealth(2, 100);
    SetPlayerHealth(3, 100);
    SetPlayerHealth(4, 100);
    SetPlayerHealth(5, 100);
    SetPlayerHealth(6, 100);
    SetPlayerHealth(7, 100);
    SetPlayerHealth(8, 100);
    SetPlayerHealth(9, 100);
    SetPlayerHealth(10, 100);
    SetPlayerHealth(11, 100);
    SetPlayerHealth(12, 100);
    SetPlayerHealth(13, 100);
    SetPlayerHealth(14, 100);
    SetPlayerHealth(15, 100);
    SetPlayerHealth(16, 100);
    SetPlayerHealth(18, 100);
    SetPlayerHealth(19, 100);
    SetPlayerHealth(20, 100);
    SetPlayerHealth(21, 100);
    SetPlayerHealth(22, 100);
    SetPlayerHealth(23, 100);
    SetPlayerHealth(24, 100);
    SetPlayerHealth(25, 100);
    SetPlayerHealth(26, 100);
    SetPlayerHealth(27, 100);
    SetPlayerHealth(28, 100);
    SetPlayerHealth(29, 100);
    SetPlayerHealth(30, 100);
    SendClientMessageToAll( CINZA, "** O Administrador do Server deu Vida para todos os Players.");
    return 1;
   }
     else
   {
    SendClientMessage(playerid, VERMELHOESCURO,"Vocк nгo tem permissгo para usar este comando.");
    return 1;
     }
}
    if (strcmp("/coletet", cmdtext, true, 10) == 0)
{
     if(IsPlayerAdmin(playerid))
     {
    SetPlayerArmour(0, 100);
    SetPlayerArmour(1, 100);
    SetPlayerArmour(2, 100);
    SetPlayerArmour(3, 100);
    SetPlayerArmour(4, 100);
    SetPlayerArmour(5, 100);
    SetPlayerArmour(6, 100);
    SetPlayerArmour(7, 100);
    SetPlayerArmour(8, 100);
    SetPlayerArmour(9, 100);
    SetPlayerArmour(11, 100);
    SetPlayerArmour(12, 100);
    SetPlayerArmour(13, 100);
    SetPlayerArmour(14, 100);
    SetPlayerArmour(15, 100);
    SetPlayerArmour(16, 100);
    SetPlayerArmour(17, 100);
    SetPlayerArmour(18, 100);
    SetPlayerArmour(19, 100);
    SetPlayerArmour(20, 100);
    SetPlayerArmour(21, 100);
    SetPlayerArmour(22, 100);
    SetPlayerArmour(23, 100);
    SetPlayerArmour(24, 100);
    SetPlayerArmour(25, 100);
    SetPlayerArmour(26, 100);
    SetPlayerArmour(27, 100);
    SetPlayerArmour(28, 100);
    SetPlayerArmour(29, 100);
    SetPlayerArmour(30, 100);
    SendClientMessageToAll( CINZA, "** O Administrador do Server deu Colete para todos os Players.");
    return 1;
   }
     else
   {
    SendClientMessage(playerid, VERMELHOESCURO,"Vocк nгo tem permissгo para usar este comando.");
    return 1;
     }
}
    if (strcmp("/ajuda", cmdtext, true, 10) == 0)
{
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"AJUDA","\t Para saber os Comandos do Servidor digite /Comandos\n\t Para saber os Comandos de Admin digite: /ComandosAdmin\n\t Para saber as Regras digite /Regras ","Ok","Voltar");
}
    return 1;
}
Recйm comeзei a mexer em pawno, desculpa qualquer coisa...
Sou muito noob ainda...

+REP


Re: [AJUDA] error 079: inconsistent return types (array & non-array) - Don_Speed - 23.04.2012

pawn Код:
if(strfind(cmdtext, "/ir", true) == 0)// nao e strfind e sim strcmp
{
    if(cmdtext[3] == EOS || cmdtext[3] == 32)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHOESCURO, "Vocк nгo tem permissгo para usar esse comando.");
        if(cmdtext[3] != 32 || (cmdtext[4] == 0 && cmdtext[3] == 32)) return SendClientMessage(playerid, AZULESCURO, "Digite: /ir [id do jogador]");
        new Float:P_Pos[3];
        new var;
        var = strval(cmdtext[4]);
        GetPlayerPos(var, P_Pos[0], P_Pos[1], P_Pos[2]);
        SetPlayerPos(playerid, P_Pos[0], P_Pos[1], P_Pos[2]);
        format(cmdtext, 128, "** Vocк foi atй a localizaзгo do ID %i.", var);
        SendClientMessage(playerid, CINZA, cmdtext);
    }//tudo que abre fecha
    return 1;
 }



Re: [AJUDA] error 079: inconsistent return types (array & non-array) - ViniBorn - 23.04.2012

strfind? lol


Re: [AJUDA] error 079: inconsistent return types (array & non-array) - dPlaYer_ - 23.04.2012

pawn Код:
if(strcmp(cmd, "/vidat", true) == 0)
{
    if(IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, VERMELHOESCURO,"Vocк nгo tem permissгo para usar este comando.");
    SendClientMessageToAll( CINZA, "** O Administrador do Server deu Vida para todos os Players.");
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerHealth(i,100);
        }
    }
    return 1;
}

if(strcmp(cmd, "/colete", true) == 0)
{
    if(IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, VERMELHOESCURO,"Vocк nгo tem permissгo para usar este comando.");
    SendClientMessageToAll( CINZA, "** O Administrador do Server deu Colete para todos os Players.");
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerArmour(i,100);
        }
    }
    return 1;
}