open.mp forum
[Server] error 090: public functions may not return arrays (symbol "GetRegionName") - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Support (https://forum.open.mp/forumdisplay.php?fid=12)
--- Thread: [Server] error 090: public functions may not return arrays (symbol "GetRegionName") (/showthread.php?tid=2259)



error 090: public functions may not return arrays (symbol "GetRegionName") - hiwyn - 2021-12-14

Why i'm getting this error:



error 090: public functions may not return arrays (symbol "GetRegionName")

return string;



on this:



Code:
forward GetRegionName(Float: X, Float: Y, Float: Z);

public GetRegionName(Float: X, Float: Y, Float: Z) {

? ? new string[128];

? ? format(string, sizeof(string), "Idlewood");

? ? return string;

}



RE: error 090: public functions may not return arrays (symbol "GetRegionName") - hiwyn - 2021-12-14

i've change:

Code:
forward GetRegionName(Float: X, Float: Y, Float: Z);

public GetRegionName(Float: X, Float: Y, Float: Z) {

    new string[128];

    format(string, sizeof(string), "Idlewood");

    return string;

}



to

Code:
stock GetRegionName(Float: X, Float: Y, Float: Z) {

    new string[128];

    format(string, sizeof(string), "Idlewood");

    return string;

}



works but idk why