Es.getAddonPath
From EventScripts Community Encyclopedia
|
[edit] Method: getAddonPathModule: es [edit] Method Overview[edit] Table of Contents
[edit] DescriptionGets the Path of the given addon name. [edit] Argumentsaddonname - the name of the addon
[edit] Examplesimport es es.msg(es.getAddonPath("test")) # would print the path to the addon test, which ends like ../addons/eventscripts/test/ import es import time filepath = es.getAddonPath("test") + '/attackerfile.txt' # the path to the file def player_death(event_var): """ If someone dies write it down to a file """ reason = "%s killed %s" % (event_var['es_attackername'],event_var['es_username']) currenttime = time.strftime('%x %X') # gets the current time in <date> <time> f = open(filepath,'a') # opens the file f.write(currenttime + " - " + reason + "\n") # writes down the time and the reason and adds a new line f.close() # closes the file [edit] NotesDoesn't work with subaddons. [edit] See Also |
|
