Rank system newbie question
#1

hi,
id like to script a rank system: as soon as someone has 20 kills he is promoted to noob killer, with 100 kills hell be a grammy shooter and so on.
Is it possible to script it like that:

pawn Код:
{
    switch(kills[playerid])
    {
        case 0:
        {
            if(kills[playerid] == 20)
            {
                Rank[playerid]++;
                SendClientMessage(playerid,0x78FF6CAA,"Congratulations! You promoted to rank noob shooter, +$200!");
                GivePlayerMoney(playerid,200);
            }
        }
        case 1:
        {
            if(kills[playerid] == 100)
            {
                Rank[playerid]++;
                SendClientMessage(playerid,0x78FF6CAA,"Congratulations! You promoted to grammy shooter, and earned $1200!");
                GivePlayerMoney(playerid,1200);
            }
        }
        case 2:
        {
            if(kills[playerid] == 500)
            {
                Rank[playerid]++;
                SendClientMessage(playerid,0x78FF6CAA,"Congratulations! You promoted to what ever, and earned $2300!");
                GivePlayerMoney(playerid,2300);
            }
        }

    }
}



if(strcmp(cmdtext,"/stats",true)==0)
{

new str[50];
format(str,sizeof(str),"Your rank is %d",GetPlayerRank(playerid));
SendClientMessage(playerid,0xFFFF00AA,str);

return 1;
}



stock GetPlayerRank(playerid)
{
    return Rank[playerid];
}
If its possible with this code somehow, where do i have to paste it in and what do i have to add??

regards.
Reply


Messages In This Thread
Rank system newbie question - by BlackWolf120 - 02.12.2010, 19:16
Re: Rank system newbie question - by Hiddos - 02.12.2010, 19:38
Re: Rank system newbie question - by BlackWolf120 - 02.12.2010, 19:46
Re: Rank system newbie question - by BlackWolf120 - 02.12.2010, 20:43
Re: Rank system newbie question - by BlackWolf120 - 02.12.2010, 22:22
Re: Rank system newbie question - by BigAl - 02.12.2010, 22:36
Re: Rank system newbie question - by HotRod - 02.12.2010, 23:51
Re: Rank system newbie question - by Kitten - 03.12.2010, 00:01
Re: Rank system newbie question - by BlackWolf120 - 04.12.2010, 15:25
Re: Rank system newbie question - by BlackWolf120 - 05.12.2010, 01:40

Forum Jump:


Users browsing this thread: 1 Guest(s)