Problem with OnPlayerDeath...Need Help
#1

Hey I got a question/problem and I really need your help

I would like to make something similar to the Ranks...I mean you have to kill e.g 5 people to get rank 2 and 10 people to get rank 3 and so on... I was wondering maybe OnPlayerDeath then killerid and give him a rank, I am not sure that's why I am asking you cos' Im confused.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)

{

    if(killerid == INVALID_PLAYER_ID) {

    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);

    } else {

    if(gTeam[killerid] != gTeam[playerid]) {
        SendDeathMessage(killerid,playerid,reason);
            SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
            GivePlayerMoney(killerid, 1000);

}
        else {
        new warning[256];
        format(warning, sizeof(warning), "Do not kill your Team-Mates ! YOU GOT PUNISHED FOR TEAM KILLING !");
        SendClientMessage(killerid, 0xFFFF00AA, warning);
        SendDeathMessage(killerid,playerid,reason);
        GivePlayerMoney(killerid, -1000);
        SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
}
    return 1;

}
See in the first bit of code, there is something like GetPlayerName(killerid, then I would like to set up a +1 kill, so when he reaches up to 10 kills he gets Rank Level 2, Rank name e.g Rocky or something lol

I would really like to get this code, it's very important for me Thanks in advance !
Reply
#2

what you're asking for is pretty simple Damarcu$. If you can be a bit more specific it would help. Do you want the killer to lose his rank once he dies? and do you want the players rank t be stored forever? If tha's the case you'll need to save the ranks in a file or something.

If it's like a kill spree, check this filterscript out:

http://forum.sa-mp.com/index.php?topic=45420.0

Reply
#3

Yes I would like it to stay forever and save it in a file along with Player Name Money etc ( i already have player name and money in the file)

Thanks I will check this filterscript out

EDIT : not sure if it's exactly what I was looking for. I want when the player kills another player he get's a rank point +1 kill, and he has to kill e.g 5 people to get rank 2 and 10 people to get rank 3 and so on. Maybe some kind of rank stats when he types /rank it shows him his rank, and it saves to a file Would be great if you can help, dont' know if that is the good filterscript for me Thanks in advance
Reply
#4

Seems like a script request though
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)