Get Rank
#1

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
Reply
#2

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);
Reply
#3

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?
Reply
#4

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

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
Reply
#6

If you are using y_ini, then

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)