Help me with Revenge. [REP ++] - 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)
+--- Thread: Help me with Revenge. [REP ++] (
/showthread.php?tid=429604)
Help me with Revenge. [REP ++] -
Configuration - 10.04.2013
Hi.
I need help with Revenge if player kill me and i go kill it in 2 time Get money Bouns.
Re: Help me with Revenge. [REP ++] -
Faisal_khan - 10.04.2013
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.
Re: Help me with Revenge. [REP ++] -
Configuration - 10.04.2013
But how i dont have any idea
Re: Help me with Revenge. [REP ++] -
[XST]O_x - 10.04.2013
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;
}
Re: Help me with Revenge. [REP ++] -
Configuration - 10.04.2013
Thanks you Sir.
Re: Help me with Revenge. [REP ++] -
Om3n - 10.04.2013
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.
Re: Help me with Revenge. [REP ++] -
Configuration - 10.04.2013
Np and Thanks.