warning 225: unreachable code
#1

Код:
CMD:giveall(playerid, params[])
{
    new value;
    if(PlayerInfo[playerid][pPadmin] == 0) return SendClientMessage( playerid, -1, "Tu ne pagrindinis administratorius!" );
    if(sscanf(params, "d", value) != 0) SendClientMessage(playerid, 0xFFFFFFFF, "Naudojimas /giveall [kiek]"); return 1;
        for(new i; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i))
        {
            GivePlayerMoney(i, value);
        }
}
    return 1;
}
Reply
#2

pawn Код:
CMD:giveall(playerid, params[])
{
    new value;
    if(PlayerInfo[playerid][pPadmin] == 0) return SendClientMessage( playerid, -1, "Tu ne pagrindinis administratorius!" );
    if(sscanf(params, "d", value) != 0)return  SendClientMessage(playerid, 0xFFFFFFFF, "Naudojimas /giveall [kiek]"); return 1;
        for(new i; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i))
        {
            GivePlayerMoney(i, value);
        }
}
    return 1;
}
Reply
#3

Actually:
pawn Код:
CMD:giveall(playerid, params[])
{
    new value;
    if(PlayerInfo[playerid][pPadmin] == 0) return SendClientMessage( playerid, -1, "Tu ne pagrindinis administratorius!" );
    if(sscanf(params, "d", value) != 0) return  SendClientMessage(playerid, 0xFFFFFFFF, "Naudojimas /giveall [kiek]");
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GivePlayerMoney(i, value);
        }
    }
    return 1;
}
The code above my post (by Dark Rain) would still output the warning
One of your problems was the indentation too
Reply
#4

Quote:
Originally Posted by zombieking
Посмотреть сообщение
Actually:
pawn Код:
CMD:giveall(playerid, params[])
{
    new value;
    if(PlayerInfo[playerid][pPadmin] == 0) return SendClientMessage( playerid, -1, "Tu ne pagrindinis administratorius!" );
    if(sscanf(params, "d", value) != 0) return  SendClientMessage(playerid, 0xFFFFFFFF, "Naudojimas /giveall [kiek]");
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GivePlayerMoney(i, value);
        }
    }
    return 1;
}
The code above my post (by Dark Rain) would still output the warning
One of your problems was the indentation too
Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)