Server-side hooks of the Friendly Combine plugin that set the relationship between Combine NPCs and each player.
Players are named f_combine or f_human and the listed NPC classes (metrocops, soldiers, scanners, turrets,
striders and so on) are told to like the first and hate the second. MPF, OTA, the admin faction, holders of a
combine_security_card and ragdolled players count as friendly; the relationship is refreshed when a character
loads, an NPC is spawned, a player is ragdolled or gets up, and a card is given or taken. PlayerTakeDamage also
scales the damage these NPCs deal.
Summary
Hooks
Hooks
PLUGIN:PlayerCharacterLoaded(player)
server gamemodes/cwhl2rp/plugins/friendlycombine/plugin/sv_hooks.lua:78Implements hook PlayerCharacterLoaded
Called after a player's character has loaded; sets whether Combine NPCs are friendly towards them.
MPF, OTA, the admin faction and players carrying a Combine security card are friendly; everyone else is hostile.
Parameters
- player Player The player whose character loaded
PLUGIN:PlayerItemGiven(player, itemTable, bForce)
server gamemodes/cwhl2rp/plugins/friendlycombine/plugin/sv_hooks.lua:104Implements hook PlayerItemGiven
Called when a player is given an item; a Combine security card makes Combine NPCs friendly.
Parameters
- player Player The player who received the item
- itemTable Item The item that was given
- bForce Boolean Whether the item was given regardless of inventory limits
PLUGIN:PlayerItemTaken(player, itemTable)
server gamemodes/cwhl2rp/plugins/friendlycombine/plugin/sv_hooks.lua:94Implements hook PlayerItemTaken
Called when an item is taken from a player; losing a Combine security card makes Combine NPCs hostile.
The hook runs before the card is removed, so this applies when it is the player's last card.
Parameters
- player Player The player who lost the item
- itemTable Item The item that was taken
PLUGIN:PlayerRagdolled(player, state, ragTab)
server gamemodes/cwhl2rp/plugins/friendlycombine/plugin/sv_hooks.lua:56Implements hook PlayerRagdolled
Called when a player is ragdolled; makes Combine NPCs treat the player as friendly while down.
Parameters
- player Player The player who was ragdolled
- state Number The new ragdoll state, a
RAGDOLL_*value - ragTab Map The player's ragdoll data
PLUGIN:PlayerSpawnedNPC(player, npc)
server gamemodes/cwhl2rp/plugins/friendlycombine/plugin/sv_hooks.lua:42Called after a player spawns an NPC; makes a new Combine NPC hate non-Combine players.
The NPC also likes Combine players unless the combine_attack_combine config is enabled.
Parameters
- player Player The player who spawned the NPC
- npc NPC The NPC that was spawned
PLUGIN:PlayerTakeDamage(victim, inflictor, attacker, hitGroup, damageInfo)
server gamemodes/cwhl2rp/plugins/friendlycombine/plugin/sv_hooks.lua:119Implements hook PlayerTakeDamage
Called when a player takes damage; scales damage dealt by Combine NPCs.
Combine and security card holders take none, fallen-over players take 20 percent, and turrets deal five times their normal damage to everyone else.
Parameters
- victim Player The player taking damage
- inflictor Entity The entity that dealt the damage
- attacker Entity The entity responsible for the damage
- hitGroup Number The
HITGROUP_*that was hit - damageInfo CTakeDamageInfo The damage being dealt; scaled in place
PLUGIN:PlayerUnragdolled(player, state, ragdollTable)
server gamemodes/cwhl2rp/plugins/friendlycombine/plugin/sv_hooks.lua:66Implements hook PlayerUnragdolled
Called after a player gets up; makes Combine NPCs hostile again towards non-Combine players.
Combine, the admin faction and players carrying a Combine security card stay friendly.
Parameters
- player Player The player who was unragdolled
- state Number The ragdoll state being set, a
RAGDOLL_*value - ragdollTable Map The player's ragdoll data