I am trying to use onentitykill to add points to a player when they destroy the patrol heli.
void OnEntityKill(BaseCombatEntity heli, HitInfo Info)
{
if (heli == null) return;
if (heli is BaseHelicopter)
{
BasePlayer player = Info?.Initiator as BasePlayer;
if (player == null) return;
Puts("heli down");
int newpoints = Cachedplayerstats[player.userID].points + helicopterpoints;
Cachedplayerstats[player.userID].points = newpoints;
checkrankalreadyhad(player);
CheckRank(player, Info);
CreateGUI(player);
}
foreach (var data in Cachedplayerstats) data.Value.Save(data.Key);
return;
}When i destroy the heli, it doesn't do anything tho. Any idea why?