Need help with rank system..
#1

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)