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

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
Reply
#2

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;
}
Reply
#3

pawn Code:
stock HouseFile(houseid)
{
    new string[10];
    format(string, sizeof(string), HOUSEPATH, houseid);
    if(!fexist(string)) string = " ";
    return string;
}
Reply
#4

i used the first one thanks
Reply
#5

*** DELETED ***
Sorry i figured t out!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)