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=287198)
error 079: inconsistent return types (array & non-array) -
Stefans94 - 02.10.2011
Hello all,
I get this error:
Code:
error 079: inconsistent return types (array & non-array)
And this is the part of the script
Code:
stock HouseFile(houseid) {
new string[10];
format(string, sizeof(string), HOUSEPATH, houseid);
if(fexist(string)) {
return string;
} else {
return 0;
}
}
The error is on the line: return 0;
I can just return a string, but i don't want to return only a string, it needs to check if the file exists or not!
Please help me
Thanks
Re: error 079: inconsistent return types (array & non-array) -
Jafet_Macario - 02.10.2011
Well, you can:
pawn Code:
stock HouseFile(houseid)
{
new string[10];
format(string, sizeof(string),HOUSEPATH, houseid);
return string;
}
And after:
pawn Code:
if(fexist(HouseFile(houseid))
{
return 0;
}
Re: error 079: inconsistent return types (array & non-array) -
Pharrel - 02.10.2011
pawn Code:
stock HouseFile(houseid)
{
new string[10];
format(string, sizeof(string), HOUSEPATH, houseid);
if(!fexist(string)) string = " ";
return string;
}
Re: error 079: inconsistent return types (array & non-array) -
Stefans94 - 02.10.2011
i used the first one thanks
Re: error 079: inconsistent return types (array & non-array) -
GTLS - 18.05.2015
*** DELETED ***
Sorry i figured t out!!