Es.event
From EventScripts Community Encyclopedia
[edit] Method: eventModule: es [edit] Method Overview[edit] Table of Contents
[edit] DescriptionCreate and fire events to signal to plugins that an event has happened. It must be an event loaded via es.loadevents. Init the event with 'initialize' first, then set the values and afterwards fire it with 'fire'. This is the Python equivalent of: http://www.eventscripts.com/pages/es_event [edit] Argumentsprimary argument - can be either 'initialize', 'fire', 'setstring', 'setint', 'setfloat' and 'cancel'. event name - the name of the event to be fired name - the name of the value to be set [only used with 'setstring', 'setint' and 'setfloat'] value - the value to set name to [only used with 'setstring', 'setint' and 'setfloat']
[edit] Examples# when your event happens es.event('initialize',"player_flag") # initialize the event es.event('setstring',"player_flag","userid",userid) # set the userid to the userid es.event('setstring',"player_flag","flag",1) # set the flag to 1 es.event('setstring',"player_flag","state",2) # set the status to 2 es.event('fire',"player_flag") # fire the event def player_flag(event_var): """ Handle it like any other event """ userid = event_var["userid"] flag = event_var["flag"] state = event_var["state"] es.msg(userid + " has the flag " + flag + " and status " + state) [edit] Notes
[edit] See Also |
|
