SA-MP Forums Archive
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 
0MAX_GANGSi++) 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] = listitemAnnounce(playerid"~w~~h~Gang color have been ~n~~g~~h~updated~w~~h~."30004);
                
                
eString[0] = EOS;
                
                
format(eStringsizeof eString"GANG: {FFFFFF}Leader '{FFFF00}%s{FFFFFF}' has set a new color to your gang."PlayerName(playerid));
                
SendGangMessage(PlayerInfo[playerid][GangID], eString);
                
                foreach(new 
Player) if(PlayerInfo[playerid][GangID] == PlayerInfo[i][GangID]) SetPlayerColor(iColors[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:
pawn Код:
return;
and
pawn Код:
return 1;
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": []