warning help - 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 help (
/showthread.php?tid=521201)
warning help -
ScripteRNaBEEL - 22.06.2014
pls help me
Quote:
F:\Program Files\test\gamemodes\SATDM.pwn(2565) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
|
line no.
Quote:
if(PlayerInfo[playerid][Level] >= 0) {
|
Re: warning help -
Rittik - 22.06.2014
Show the line above
2565.
Re: warning help -
ScripteRNaBEEL - 22.06.2014
this
Quote:
if(PlayerInfo[playerid][Level] >= 0) {
new String[256];
format(String, 256, "[%d]: %s", playerid, text);
SendPlayerMessageToAll(playerid,String);
return 0;// return 0 !!!! otherwise you get a double chat message
}
return 1;
}
|
Re: warning help -
Jack_Leslie - 22.06.2014
Change the return 0 to return 1, and the return 1 below it to return 0
Re: warning help -
ScripteRNaBEEL - 22.06.2014
warning doesnt gone it coming.
Re: warning help -
Rittik - 22.06.2014
EDIT: Fixed.
Код:
public OnPlayerText(playerid, text[])
{
if(PlayerInfo[playerid][Level] >= 0)
{
new String[256];
format(String, 256, "[%d]: %s", playerid, text);
SendPlayerMessageToAll(playerid,String);
}
return 0;
}
Re: warning help -
Jack_Leslie - 22.06.2014
If you have if checks under OnPlayerText, return 1 within that if statement, and at the end of OnPlayerText, return 0;
Example:
pawn Код:
public OnPlayerText(playerid, text[])
{
if(Something)
{
...
return 1;
}
else if(!something)
{
...
return 1;
}
return 0;
}
Re: warning help -
ScripteRNaBEEL - 22.06.2014
fixed