Difference between revisions of "Player onconc"
From Fortress Forever Wiki
Jump to navigationJump to search (New page: {{Infobox manual/Header}} ==player_onconc(player_entity, effector_entity)== This function is called whenever a player receives a concussion effect. Returning false will prevent players fro...) |
(No difference)
|
Revision as of 18:48, 11 May 2009
|
player_onconc(player_entity, effector_entity)This function is called whenever a player receives a concussion effect. Returning false will prevent players from being concussed Inputs
VariablesThe following variables are set in the global lua namespace before this function is called:
Changing these variables will alter the duration of the conc effect. Ignoring them will leave them at default values. Examplesfunction player_onconc(player_entity, effector_entity) -- make conc effect last 20 seconds conc_duration = 20 -- make conc status icon last 1 second conc_iconduration = 1 return EVENT_ALLOWED -- or you can just return “true” to let the conc happen. If you return false no conc effect happens end -- player_entity is guy getting conc’d -- effector_entity is the one doing the conc’ing function player_onconc(player_entity, effector_entity) --effector_entity is a CBaseEntity type, we need to verify that it's a player before we do anything with it if isPlayer(effector_entity) then local concer = CastToPlayer(effector_entity) --Award some fortress points for concing somebody. concer:AddFortPoints(5, "Conc-Tagging a player") end --Don't actually concuss the other guy return false end |