error 078: function uses both "return" and "return <value>" - 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 078: function uses both "return" and "return <value>" (
/showthread.php?tid=644262)
error 078: function uses both "return" and "return <value>" -
Banditul18 - 05.11.2017
Im using zeex compiler and get this weird error but with original pawn compiler get nothing
PHP код:
case DIALOG_GCOLOR:
{
if(response)
{
for (new i = 0; i < MAX_GANGS; i++) if(GangInfo[i][GangColor] == listitem) return SendError(playerid, "Sorry, but the selected color are using some gang. Please select another !");
GangInfo[PlayerInfo[playerid][GangID]][GangColor] = listitem, Announce(playerid, "~w~~h~Gang color have been ~n~~g~~h~updated~w~~h~.", 3000, 4);
eString[0] = EOS;
format(eString, sizeof eString, "GANG: {FFFFFF}Leader '{FFFF00}%s{FFFFFF}' has set a new color to your gang.", PlayerName(playerid));
SendGangMessage(PlayerInfo[playerid][GangID], eString);
foreach(new i : Player) if(PlayerInfo[playerid][GangID] == PlayerInfo[i][GangID]) SetPlayerColor(i, Colors[listitem]);
}
return 1;
}
An example of piece of code that gave me that error(its almost all over OnDialogResponse)
Its just a gamemode from internet that i try to improve and use it
Re: error 078: function uses both "return" and "return <value>" -
Konstantinos - 05.11.2017
I use the latest version of the compiler and doesn't get any similar error. Basically what the error means is that you use both:
and
Check the whole OnDialogResponse callback.
Re: error 078: function uses both "return" and "return <value>" -
Banditul18 - 05.11.2017
Hmmm....If i use vs code give this errors but if i use sublime text 3 there is no errors like that
I don't know what to belive anymore
Edit: VS Code compiler task
PHP код:
{
"version": "2.0.0",
"type": "shell",
"args": [
"-Z+",
"-d3",
"${relativeFile}"
],
"windows": {
"command": "${workspaceRoot}\\pawno\\pawncc.exe"
},
"problemMatchers": []
}