SA-MP Forums Archive
Get Rank - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Get Rank (/showthread.php?tid=276338)



Get Rank - Admigo - 13.08.2011

Heey guys,
I use variables for ranks: rank0[playerid]==1.
But how can i make a getrank command so i can see rank of players?
I need it for my ini:P


Re: Get Rank - MadeMan - 13.08.2011

pawn Код:
stock GetRankName(rankid)
{
    new rankname[32];
    switch(rankid)
    {
        case 1: rankname = "Rank1";
        case 2: rankname = "Rank2";
        case 3: rankname = "Rank3";
        default: rankname = "None";
    }
    return rankname;
}
Example:
pawn Код:
format(string, sizeof(string), "Your rank is %s", GetRankName(rank0[playerid]));
SendClientMessage(playerid, -1, string);



Re: Get Rank - Admigo - 13.08.2011

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
pawn Код:
stock GetRankName(rankid)
{
    new rankname[32];
    switch(rankid)
    {
        case 1: rankname = "Rank1";
        case 2: rankname = "Rank2";
        case 3: rankname = "Rank3";
        default: rankname = "None";
    }
    return rankname;
}
Example:
pawn Код:
format(string, sizeof(string), "Your rank is %s", GetRankName(rank0[playerid]));
SendClientMessage(playerid, -1, string);
Thanks dude,i need it for ini. U know how?


Re: Get Rank - MadeMan - 13.08.2011

Quote:
Originally Posted by admigo
Посмотреть сообщение
Thanks dude,i need it for ini. U know how?
Explain more.


Re: Get Rank - Admigo - 13.08.2011

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Explain more.
I want this:
[data]
Password = 185401982
Cash = 121799
Admin = 5
Kills = 0
Deaths = 11
Score = 1500
Rank=6//just number of rank
Registered = 1
LoggedIn = 0


Re: Get Rank - MadeMan - 13.08.2011

If you are using y_ini, then

pawn Код:
INI_WriteInt(File,"Rank",rank0[playerid]);



Re: Get Rank - Admigo - 13.08.2011

Can you add playerid to GetRankName so its look like GetRankName(playerid,rankid);?


Re: Get Rank - MadeMan - 13.08.2011

Quote:
Originally Posted by admigo
Посмотреть сообщение
Can you add playerid to GetRankName so its look like GetRankName(playerid,rankid);?
Why?


Re: Get Rank - Admigo - 13.08.2011

I just want make a command that if i use on player i can see the rank lvl of player.


Re: Get Rank - MadeMan - 13.08.2011

pawn Код:
stock GetPlayerRank(playerid)
{
    new rankname[32];
    switch(rank0[playerid])
    {
        case 1: rankname = "Rank1";
        case 2: rankname = "Rank2";
        case 3: rankname = "Rank3";
        default: rankname = "None";
    }
    return rankname;
}