warning help
#1

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) {

Reply
#2

Show the line above 2565.
Reply
#3

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;
}

Reply
#4

Change the return 0 to return 1, and the return 1 below it to return 0
Reply
#5

warning doesnt gone it coming.
Reply
#6

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;
}
Reply
#7

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;
}
Reply
#8

fixed
Reply


Forum Jump:


Users browsing this thread: