warning 225: unreachable code
#1

I compile my gamemode and i get this warning. Can someone help me?


pawn Код:
(43531) : warning 225: unreachable code
pawn Код:
if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
    {
        if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
        {
            if(PlayerInfo[playerid][pPbiskey] != i)
            {
                if(SBizzInfo[i][sbLocked] == 1)
                {
                    GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
                    return 1;
                }
                if(SBizzInfo[i][sbProducts] == 0)
                {
                    GameTextForPlayer(playerid, "~r~Out of stock", 5000, 1);
                    return 1;
                }
                else
                {
                    return 1;
                }
                new string[256];
                SafeGivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
                gSpentCash[playerid] = GetPlayerMoney(playerid);
                SBizzInfo[i][sbProducts]--;
                SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
                ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]);
                new dood[MAX_PLAYER_NAME];
                GetPlayerName(playerid, dood, sizeof(dood));
                format(string, sizeof(string), "%s [Text] $%d [text] %d", dood, SBizzInfo[i][sbEntranceCost], i);
                printf("%s", string);
                PayLog(string);
                OnPropUpdate();
            }
        }
        else
        {
            GameTextForPlayer(playerid, "~r~You don't have money.", 5000, 1);
        }
    }
}
}
    return 1; }
pawn Код:
new string[256];
Reply
#2

This
pawn Код:
if(SBizzInfo[i][sbProducts] == 0)
                {
                    GameTextForPlayer(playerid, "~r~Out of stock", 5000, 1);
                    return 1;
                }
                else
                {
                    return 1;
                }
If there are no products, quit. If there are products, quit as well. The code below this block can never be reached, hence the warning.
Reply
#3

Thanks man.

But now i script on and get this error.
pawn Код:
(42806) : error 021: symbol already defined: "NameTimer"
pawn Код:
public NameTimer()
{
    for(new i = 0;i < MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            for(new q = 0;q < MAX_PLAYERS;q++)
            {
                if(IsPlayerConnected(q))
                {
                    new Float:p1x;
                    new Float:p1y;
                    new Float:p1z;
                    new Float:p2x;
                    new Float:p2y;
                    new Float:p2z;
                    if(IsPlayerConnected(i) && IsPlayerConnected(q))
                    {
                        GetPlayerPos(i,p1x,p1y,p1z);
                        GetPlayerPos(q,p2x,p2y,p2z);
                        if(GetPointDistanceToPointExMorph(p1x,p1y,p1z,p2x,p2y,p2z) < pdistance)
                        {
                            if(PlayerInfo[q][pMaskuse] != 1)
                            {
                                ShowPlayerNameTagForPlayer(i,q,1);
                            }
                        }
                        else
                        {
                            ShowPlayerNameTagForPlayer(i,q,0);
                        }
                    }
                }
            }
        }
    }
}
pawn Код:
public NameTimer()
Reply
#4

Change the callback's name.
Reply
#5

I'dont understand what you are saying. I am not English.
Reply
#6

pawn Код:
// Global Variable
new
    NameTimer
;

// Somewhere in your script:
public NameTimer() // <-- error 021: symbol already defined: "NameTimer"
{
    for(new i = 0;i < MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            for(new q = 0;q < MAX_PLAYERS;q++)
            {
                if(IsPlayerConnected(q))
                {
                    new Float:p1x;
                    new Float:p1y;
                    new Float:p1z;
                    new Float:p2x;
                    new Float:p2y;
                    new Float:p2z;
                    if(IsPlayerConnected(i) && IsPlayerConnected(q))
                    {
                        GetPlayerPos(i,p1x,p1y,p1z);
                        GetPlayerPos(q,p2x,p2y,p2z);
                        if(GetPointDistanceToPointExMorph(p1x,p1y,p1z,p2x,p2y,p2z) < pdistance)
                        {
                            if(PlayerInfo[q][pMaskuse] != 1)
                            {
                                ShowPlayerNameTagForPlayer(i,q,1);
                            }
                        }
                        else
                        {
                            ShowPlayerNameTagForPlayer(i,q,0);
                        }
                    }
                }
            }
        }
    }
}
You've defined it as a variable and then use the same name as a callback. Just change the name.
Reply
#7

Wtf? I cant make it Just make me right script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)