1 Warning error. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 1 Warning error. (
/showthread.php?tid=176510)
1 Warning error. -
VitalRP - 13.09.2010
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.
Re: 1 Warning error. -
thomas.. - 13.09.2010
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
Re: 1 Warning error. -
VitalRP - 13.09.2010
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