20.02.2015, 07:00
I want to make a kill assist,any ideas on how to start?
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;
}