Kill assist help - 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: Kill assist help (
/showthread.php?tid=564205)
Kill assist help -
Nabster - 20.02.2015
I want to make a kill assist,any ideas on how to start?
Re: Kill assist help -
Gammix - 20.02.2015
pawn Код:
new assist[MAX_PLAYERS] = INVALID_PLAYER_ID;
public OnPlayerGiveDamage(playerid, damageid, Float:amount, weaponid, bodypart)
{
if(GetPlayerTeam(playerid) != GetPlayerTeam(damageid)) return 0;
assist[damageid] = playerid;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(assist[playerid] != killerid && assist[playerid] != INVALID_PLAYER_ID)
{
SendClientMessage(assist[playerid], -1, "+500$ for assist");
assist[playerid] = INVALID_PLAYER_ID;
}
return 1;
}
Just an simple example. You can use arraysfor multiple assists.
Re: Kill assist help -
Nabster - 20.02.2015
Alright i will try to make one