SA-MP Forums Archive
Case help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Case help (/showthread.php?tid=315757)



Case help - Azzeto - 04.02.2012

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?


Re: Case help - [XST]O_x - 04.02.2012

What?

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


Re: Case help - Konstantinos - 04.02.2012

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

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



Re: Case help - [XST]O_x - 04.02.2012

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



Re: Case help - Konstantinos - 04.02.2012

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


Re: Case help - Azzeto - 04.02.2012

Repped, Both of you