SA-MP Forums Archive
Ranks - 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: Ranks (/showthread.php?tid=286915)



Ranks - [GOD]Dragonster82 - 01.10.2011

Hello there people, i've searched everywhere but to no avail, I am unable to find how to make ranks.


Of course, i know

new GangRank;
new PoliceRank;

but...
What next?


Re: Ranks - Raimis_R - 01.10.2011

I made ex

pawn Код:
new GangRanks[MAX_PLAYERS];

stock GetPlayerRangInString(playerid)
{
    new str[20];
   
    switch(GangRanks[playerid])
    {
        case 0: "None";
        case 1: "Member";
        case 2: "Gangsta";
        case 3: "Leader";
    }
    return str;
}

stock GetPlayerRangInInt(playerid)return GangRanks[playerid];

stock SetPlayerGangRank(playerid, level)
{
    GangRanks[playerid] = level;
   
    new str[100];
    format(str, 100, "Your new Gang Level \"%s\"", GetPlayerRangInString(playerid));
    SendClientMessage(playerid, -1, str);
}



Re: Ranks - park4bmx - 01.10.2011

ok so you got the first bit
this is a really simple way
pawn Код:
new GangRank[MAX_PLAYERS];
new PoliceRank[MAX_PLAYERS];
//[MAX_PLAYERS] so its for player each not global

//then when you want to set the players team just do
GangRank[playerid]=1;
//that would make the player have GangRank to 1
//and to check if the player is in that Rank you do
if(GangRank[playerid]==1){
//your code if the player is in that Rank
}



Re: Ranks - [GOD]Dragonster82 - 01.10.2011

Thank you people.