SA-MP Forums Archive
error 079: inconsistent return types (array & non-array) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 079: inconsistent return types (array & non-array) (/showthread.php?tid=477459)



error 079: inconsistent return types (array & non-array) - GrandParadise - 24.11.2013

Код:
stock AdminLevelName(playerid)
{
    new
        szString[12]
    ;
    switch (PInfo[playerid][Level])
    {
        case 1: szString = "Trial admin";
        case 2: szString = "...";
        case 3: szString = "...";
        case 4: szString = "...";
        case 5: szString = "...";
        default:  szString = "none";
    }
    return szString;
}

	if(strcmp(cmd,"/asay",true)==0)	{
	if(PlayerInfo[playerid][Level] >= 1) {
		new tmp[256];
		tmp = strtok(cmdtext, idx);

		if(!strlen(tmp)) {
		SendClientMessage(playerid, red, "USAGE: /asay [text]");
		return 1;		}

		GetPlayerName(playerid, adminname, sizeof(adminname));
		format(string, sizeof(string), "[%s] %s: %s",adminlevel, adminname,cmdtext[6]);
		SendClientMessageToAll(red,string);
	} else	{ 
  	SendClientMessage(playerid,red,"You are not a level 1 admin");   }
	return 1;	}
Код:
C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(881) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(882) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(883) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(884) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(885) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(886) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(887) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(888) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(889) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(890) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(891) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(892) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(893) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(894) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(895) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(908) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(923) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(964) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(975) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(983) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(1002) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(1013) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(1021) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(1023) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(1031) : error 079: inconsistent return types (array & non-array) C:\Users\SHIT\Desktop\LAST\filterscripts\ladmin2.pwn(1049) : error 079: inconsistent return types (array & non-array)



Re: error 079: inconsistent return types (array & non-array) - Konstantinos - 24.11.2013

Do those lines that give the error use AdminLevelName?

I think the error means that you return in a function a string and another type such as integer when it should return the same type. The function (AdminLevelName) you posted above seems fine.