error 079: inconsistent return types (array & non-array
#1

Код:
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
}
Reply
#2

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.
Reply
#3

Thank you very much.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)