Case help
#1

How can I get my admin rank using a case? In a stock?

for example

stock AdminRank(playerid)
{

Blahblah what would I do inside of the brackets? I know I'd use cases but how?
Reply
#2

What?

pawn Код:
stock AdminRank(playerid)
{
    return pInfo[playerid][admin_level];
}
Or elaborate.
Reply
#3

pawn Код:
stock AdminRank( playerid )
{
    new
        rank[ 32 ];

    switch( PlayerInfo[ playerid ][ Admin ] )
    {
        case 0: rank = "Normal";
        case 1: rank = "Helper";
        // continue..
    }
    return 1;
}
Reply
#4

Oh I see.

But you need to return the rank.


pawn Код:
stock AdminRank( playerid )
{
    new
        rank[ 32 ];

    switch( PlayerInfo[ playerid ][ Admin ] )
    {
        case 0: rank = "Normal";
        case 1: rank = "Helper";
        // continue..
    }
    return rank;
}
Reply
#5

Oh yeah, I forgot that.
Sorry and thanks [XST]O_x
Reply
#6

Repped, Both of you
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)