Es event fire
From EventScripts Community Encyclopedia
|
[edit] OverviewSyntax: Note: Command parameters are described inside the
< and > characters. Optional parameters are contained within [ and ] characters.Variation of this command that doesn't expand variables: es_xevent fire [edit] DescriptionSends an event to all plugins and scripts. Must be initialized very soon before calling fire. [edit] Parameters
[edit] Examples// EventScripts: Event Firing Example v0.1 // FriendlyFire Evens. // The following script and corresponding es_ffevents.res file is // an example of how to create your own events in your scripts. // // These events can be consumed just like any other events provided // by Source. block load { es_loadevents declare addons/eventscripts/examples/ffevents/es_ffevents.res } event es_map_start { es_loadevents addons/eventscripts/examples/ffevents/es_ffevents.res } event player_hurt { if (event_var(es_userteam) == event_var(es_attackerteam)) do { if (event_var(userid) != event_var(attacker)) do { // create the teammate_hurt event so other scripts know. es_xevent initialize teammate_hurt es_event setint teammate_hurt userid event_var(userid) es_event setint teammate_hurt attacker event_var(attacker) es_xevent fire teammate_hurt } } } event player_death { if (event_var(es_userteam) == event_var(es_attackerteam)) do { if (event_var(userid) != event_var(attacker)) do { // create the teammate_kill event so other scripts know. es_xevent initialize teammate_kill es_event setint teammate_kill userid event_var(userid) es_event setint teammate_kill attacker event_var(attacker) es_xevent fire teammate_kill } } } // example ways to consume the event, just like a normal event event teammate_hurt { es_log User event_var(es_attackername) attacked a teammate, event_var(es_username) } event teammate_kill { es_log User event_var(es_attackername) killed a teammate, event_var(es_username) }
[edit] Notes
[edit] See also
|
