1 Warning error.
#1

I've looked at this and i can't find out why im getting this error
Код:
warning 209: function "cmd_listenchat" should return a value
the script warning is apparantly on this line (below command(savedata,)

Код:
command(savedata, playerid, params[])
{
Now it says that the cmd should return a value, but it says the warning is after the command above (savedata). Here's the command
Код:
command(listenchat, playerid, params[])
	#pragma unused params
	if( Player[playerid][AdminLevel] >= 4)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (!BigEar[playerid])
			{
				BigEar[playerid] = 1;
				return 1;
			}
			else if (BigEar[playerid])
			{
				(BigEar[playerid] = 0);
				return 1;
			}
		}

		return 1;
	}
Any help?

Solved it myself.
Reply
#2

pawn Код:
command(listenchat, playerid, params[])
    #pragma unused params
    if( Player[playerid][AdminLevel] >= 4)
    {
        if(IsPlayerConnected(playerid))
        {
            if (!BigEar[playerid])
            {
                BigEar[playerid] = 1;
                return 1;
            }
            else if (BigEar[playerid])
            {
                (BigEar[playerid] = 0);
                return 1;
            }
        }
         }

        return 1;
    }
?

or

pawn Код:
command(listenchat, playerid, params[])
    #pragma unused params
    if( Player[playerid][AdminLevel] >= 4)
    {
        if(IsPlayerConnected(playerid))
        {
            if (!BigEar[playerid])
            {
                BigEar[playerid] = 1;
                return 1;
            }
            else if (BigEar[playerid])
            {
                (BigEar[playerid] = 0);
                return 1;
            }
        }

        return 1;
    }
        return 0;
}
p.s

crappy indentaion cuz i used spaces xd
Reply
#3

That wont work, adding return 0; after is an invalid function, so that turns it into an error, atm its only a warning so i dont mind that much, it's just i want the script to be 100% clean
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)