SA-MP Forums Archive
Need help with rank system.. - 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: Need help with rank system.. (/showthread.php?tid=254425)



Need help with rank system.. - XrespenserX - 10.05.2011

If In-Game someone reachs the amount of kills to rank up, the player who got killed got rank up. can someone fix it pls? I really need this!

pawn Код:
if(GetPlayerScore(killerid) == 5) // Amount of required kills to get rank 1 *Corporal*
    {
        GetPlayerName(killerid, string, sizeof(string) );
        format(string, sizeof(string), ">> %s advanced to rank *Corporal* by killing %d players", string, GetPlayerScore(killerid) );
        SendClientMessageToAll(COLOR_LIGHTBLUE, string);
        pRank[playerid] = 1;
    }
    else if(GetPlayerScore(killerid) == 25) // Amount of required kills to get rank 2 *Sergeant*
    {
        GetPlayerName(killerid, string, sizeof(string) );
        format(string, sizeof(string), ">> %s advanced to rank *Sergeant* by killing %d players", string, GetPlayerScore(killerid));
        SendClientMessageToAll(COLOR_LIGHTBLUE, string);
        pRank[killerid] = 2;
    }
    else if(GetPlayerScore(killerid) == 50) // Amount of required kills to get rank 3 *Lieutenant*
    {
        GetPlayerName(killerid, string, sizeof(string) );
        format(string, sizeof(string), ">> %s advanced to rank *Lieutenant* by killing %d players", string, GetPlayerScore(killerid));
        SendClientMessageToAll(COLOR_LIGHTBLUE, string);
        pRank[killerid] = 3;
    }
    else if(GetPlayerScore(killerid) == 150) // Amount of required kills to get rank 4 *Captain*
    {
        GetPlayerName(killerid, string, sizeof(string) );
        format(string, sizeof(string), ">> %s advanced to rank *Captain* by killing %d players", string, GetPlayerScore(killerid));
        SendClientMessageToAll(COLOR_LIGHTBLUE, string);
        pRank[killerid] = 4;
    }
    else if(GetPlayerScore(killerid) == 300) // Amount of required kills to get rank 5 *General*
    {
        GetPlayerName(killerid, string, sizeof(string) );
        format(string, sizeof(string), ">> %s advanced to rank *General* by killing %d players", string, GetPlayerScore(killerid));
        SendClientMessageToAll(COLOR_LIGHTBLUE, string);
        pRank[killerid] = 5;
    }

        GetPlayerName(playerid,name,sizeof(name));
    GetPlayerName(killerid,Killername,sizeof(Killername));
    if(Kills[playerid] > 2)
    {
        GivePlayerMoney(killerid,3000*GetPlayerWantedLevel(playerid));
        format(st,sizeof(st),"%s was awarded %d for killing %s wanted level %d",Killername,3000*GetPlayerWantedLevel(playerid),name,GetPlayerWantedLevel(playerid));
        SendClientMessageToAll(COLOR_YELLOW,st);
    }



Re: Need help with rank system.. - SkizzoTrick - 10.05.2011

pawn Код:
pRank[playerid] = 1;
Change it with:
pawn Код:
pRank[killerid] = 1;