stock problem
#6

pawn Код:
stock GetAdminName(playerid)
{
    new adminname[129];
    if ( PlayerInfo [ playerid ] [ Level ] > 0)
    {
        case 1: adminname = "Admininstrator";                // can't do this
        case 2: adminname = "General Admininstrator";
        case 3: adminname = "Senior Admininstrator";
        case 4: adminname = "Head Admininstrator";
        case 5: adminname = "Chief";
        case 6: adminname = "Server Owner";
    }
    return adminname;
}
You have to do this instead

pawn Код:
stock GetAdminName(playerid)
{
    new adminname[129];
    switch ( PlayerInfo [ playerid ] [ Level ] ) // change "if" to "switch
    {
        case 1: adminname = "Admininstrator";
        case 2: adminname = "General Admininstrator";
        case 3: adminname = "Senior Admininstrator";
        case 4: adminname = "Head Admininstrator";
        case 5: adminname = "Chief";
        case 6: adminname = "Server Owner";
        default: adminname = "None";        // if none of the above cases are executed, execute this case
    }
    return adminname;
}
Reply


Messages In This Thread
stock problem - by Dangjai - 03.10.2014, 21:53
Re: stock problem - by EnforcerDon - 03.10.2014, 21:55
Re: stock problem - by EnforcerDon - 03.10.2014, 21:57
Re: stock problem - by Dangjai - 03.10.2014, 21:59
Re: stock problem - by IceCube! - 03.10.2014, 22:00
Re: stock problem - by EnforcerDon - 03.10.2014, 22:02
Re: stock problem - by Dangjai - 03.10.2014, 22:35

Forum Jump:


Users browsing this thread: 2 Guest(s)