Difference for python/guilds/guildjoin.py from version 1.1 to 1.2


version 1.1 version 1.2
Line 19
 
Line 19
 # The author can be reached via e-mail at temitchell@sourceforge.net  # The author can be reached via e-mail at temitchell@sourceforge.net
 #  #
   
 import CFPython  import Crossfire
 import CFGuilds  import CFGuilds
   
 def find_player(object):  def find_player(object):
     while (CFPython.GetType(object) != 1) : #1 is type 'Player'      while (object.Type != 1) : #1 is type 'Player'
         object = CFPython.GetPreviousObject(object)          object = object.Above
         if not object:          if not object:
             return 0              return 0
     return object      return object
         
 activator=CFPython.WhoIsActivator()  activator=Crossfire.WhoIsActivator()
 activatorname=CFPython.GetName(activator)  activatorname=activator.Name
 map = CFPython.GetMap(activator)  map = activator.Map
 whoami=CFPython.WhoAmI()  whoami=Crossfire.WhoAmI()
   
 guildname=CFPython.GetEventOptions(whoami,1) # 1 is 'apply' event  guildname=Crossfire.ScriptParameters() # 1 is 'apply' event
   
 if (guildname):  if (guildname):
     guild = CFGuilds.CFGuild(guildname)      guild = CFGuilds.CFGuild(guildname)
     #find players by coords      #find players by coords
     ob=CFPython.GetFirstObjectOnSquare(map,9,16)      ob=map.GetFirstObjectOnSquare(9,16)
     player = find_player(ob)      player = find_player(ob)
     if player: # look for player      if player: # look for player
         charname=CFPython.GetName(player)          charname=player.Name
         in_guild = CFGuilds.SearchGuilds(charname)          in_guild = CFGuilds.SearchGuilds(charname)
         if in_guild == 0:          if in_guild == 0:
             if guild.info(charname):              if guild.info(charname):
Line 59
 
Line 59
     print 'Guild Join Error: %s' %(guildname)      print 'Guild Join Error: %s' %(guildname)
     message = 'Guild Join Error, please notify a DM'      message = 'Guild Join Error, please notify a DM'
          
 CFPython.Say(whoami, message)  whoami.Say(message)
          


Legend:
line(s) removed in v.1.1 
line(s) changed
 line(s) added in v.1.2

File made using version 1.96 of cvs2html by leaf at 2006-02-15 17:33