error 078: function uses both "return" and "return <value>"
#1

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

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.
Reply
#3

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": []
} 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)