Help me with Revenge. [REP ++]
#1

Hi.
I need help with Revenge if player kill me and i go kill it in 2 time Get money Bouns.
Reply
#2

When the player killed you, store his idea in an array, then when you kill someone, check if the dead person is the one who killed you earlier.
Reply
#3

But how i dont have any idea
Reply
#4

pawn Код:
#define CASH_KILL 150

new lastkiller[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    new cashToGive;
    if( (killerid != playerid) && (playerid != INVALID_PLAYER_ID))
    {
       cashToGive = ((lastkiller[killerid] == playerid) ? (CASH_KILL * 2) : CASH_KILL));
       GivePlayerMoney(killerid, cashToGive);
       lastkiller[playerid] = killerid;
    }
    return 1;
}
Reply
#5

Thanks you Sir.
Reply
#6

up to global news:

pawn Код:
new LastKiller[MAX_PLAYERS];
and to OnPlayerDeath:

pawn Код:
if(LastKiller[killerid] == playerid)
{
    SendClientMessage(killerid, COLOR, "Revenge! + $5000");
    GivePlayerMoney(killerid, 5000);
}
LastKiller[playerid] = killerid;
its the main script.

edit: sorry, too late.
Reply
#7

Np and Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)