SA-MP Forums Archive
Warning 209: function "OnIsEmailPending" should return a 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: Warning 209: function "OnIsEmailPending" should return a value (/showthread.php?tid=515529)



Warning 209: function "OnIsEmailPending" should return a value - VladimirMark - 26.05.2014

I got this warning when I compile the server:
pawn Код:
./includes/functions.pwn(21694) : warning 209: function "OnIsEmailPending" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
And here is lines 21682-21694
pawn Код:
forward OnIsEmailPending(playerid, email[]);
public OnIsEmailPending(playerid, email[])
{
    new rows, fields;
    cache_get_data(rows, fields, MainPipeline);
    if(rows > 0)
    {
        SetPVarInt(playerid, "NullEmail", 3);
        ShowLoginDialogs(playerid, 3);
    }
    else //InvalidEmailCheck(playerid, email);
    return 1;
}
I don't know what am I doing wrong :/


Re: Warning 209: function "OnIsEmailPending" should return a value - PawnOX - 26.05.2014

Add

pawn Код:
return 1;
After

pawn Код:
ShowLoginDialogs(playerid, 3);



Re: Warning 209: function "OnIsEmailPending" should return a value - Rittik - 26.05.2014

Код:
forward OnIsEmailPending(playerid, email[]);
public OnIsEmailPending(playerid, email[])
{
    new rows, fields;
    cache_get_data(rows, fields, MainPipeline);
    if(rows > 0)
    {
        SetPVarInt(playerid, "NullEmail", 3);
        ShowLoginDialogs(playerid, 3);
    }
    else
{ 
//InvalidEmailCheck(playerid, email);
    return 1;
}
return 1;
}



Re : Warning 209: function "OnIsEmailPending" should return a value - S4t3K - 26.05.2014

Just delete the "else" statement instead of putting some useless code inside.

PHP код:
forward OnIsEmailPending(playeridemail[]);
public 
OnIsEmailPending(playeridemail[])
{
    new 
rowsfields;
    
cache_get_data(rowsfieldsMainPipeline);
    if(
rows 0)
    {
        
SetPVarInt(playerid"NullEmail"3);
        
ShowLoginDialogs(playerid3);
    }
    return 
1;




Re: Warning 209: function "OnIsEmailPending" should return a value - VladimirMark - 26.05.2014

Thanks,
REP+ all of you