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=607204)
error 079: inconsistent return types (array & non-array -
TheSimpleGuy - 16.05.2016
Код:
GetRankName(rankid)
{
new str[128];
format(str, sizeof(str), rInfo[rankid][Name]);
return str;
}
GetPlayerRank(playerid)
{
for(new i = 0; i < sizeof(rInfo[]); i++)
{
if(GetPlayerScore(playerid) >= rInfo[i][ScoreMin] && GetPlayerScore(playerid) <= rInfo[i][ScoreMax])
{
return GetRankName(i);
}
}
return 1; //error line
}
Re: error 079: inconsistent return types (array & non-array -
Sew_Sumi - 16.05.2016
Searching the errors usually yields results.
https://sampforum.blast.hk/showthread.php?tid=269410
Refer to post 3.
The error explains it a bit, but what Vince said is a little bit more detailed.
I think you want to re-do how you're getting the ranks for this command. I doesn't seem like it's very clean.
Re: error 079: inconsistent return types (array & non-array -
TheSimpleGuy - 16.05.2016
Thank you very much.
Re: error 079: inconsistent return types (array & non-array -
Sew_Sumi - 16.05.2016
Good to know you got it fixed.
It's always a good thing to ****** the error, set the site to the forums, and view about 10 different topics, of errors of the same type.
Someone will mention the "reason" whilst a few will demonstrate how they fixed it.