Wanted Level When Killing someone
#3

Quote:
Originally Posted by Dr
Посмотреть сообщение
pawn Код:
new KillerTime[MAX_PLAYERS];
new KillerLevel[MAX_PLAYERS];
forward KillerTimer(playerid);
public OnPlayerDeath(playerid, killerid, reason)
{
    KillerLevel[killerid] += 4;
    SetPlayerWantedLevel(killerid, KillerLevel[killerid]);
    KillerTime[killerid] = SetTimerEx("KillerTimer", 300000, true, "u", killerid);
    SendClientMessage(COLOR_WHITE, killerid, "You are now wanted for murder, you will lose a star every 5 minutes");
    return 1;
}

public KillerTimer(playerid)
{
    if(KillerLevel[playerid] > 0)
    {
        KillerLevel[playerid]--;
        SetPlayerWantedLevel(playerid, KillerLevel[playerid]);
    }
    else
    {
        KillerLevel[playerid] = 0;
        SendClientMessage(COLOR_WHITE, playerid, "You are now free, and not wanted anymore");
        SetPlayerWantedLevel(playerid, 0);
        KillTimer(KillerTime[playerid]);
    }
    return 1;
}
May I just say you are the best coder I've ever met!

Thanks so much! +rep!
Reply


Messages In This Thread
Wanted Level When Killing someone - by TheMightyEddy - 01.04.2012, 00:56
Re: Wanted Level When Killing someone - by Dr - 01.04.2012, 01:14
Re: Wanted Level When Killing someone - by TheMightyEddy - 01.04.2012, 01:30

Forum Jump:


Users browsing this thread: 1 Guest(s)