1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Approved KillFeed 1.1.5

this plugin send a popup on the Atacker his screen

  1. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    #1
  2. DreTaX
    Online

    DreTaX Probably knows the answer... Administrator

    Joined:
    Jun 29, 2014
    Messages:
    3,885
    Likes Received:
    685
    Approved.
     
    #2
  3. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    thx
     
    #3
  4. DreTaX
    Online

    DreTaX Probably knows the answer... Administrator

    Joined:
    Jun 29, 2014
    Messages:
    3,885
    Likes Received:
    685
    Suggestions.

    Code (Python):
    import clr
    clr.AddReferenceByPartialName("Fougerite")
    import Fougerite


    class KillNotice:
        def On_PlayerKilled(self, DeathEvent):
            # Ensure that both the killer is a player and the victim is also a player
            # This is because the killer can be "world", "npc" too, and It would cause errors.
            if DeathEvent.VictimIsPlayer and DeathEvent.AttackerIsPlayer:
                DeathEvent.Attacker.Notice("☠", "You killed " + DeathEvent.Victim.Name)
     
    #4
  5. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    I'm i allowed to upload this one as update?
     
    #5
  6. Jakkee
    Offline

    Jakkee Plugin Developer Plugin Developer Contributor

    Joined:
    Jul 28, 2014
    Messages:
    1,466
    Likes Received:
    149
    Yes, Just make sure you credit. EG: Verson Blah blah - Fix by DreTaX
     
    #6
    • Like Like x 1
  7. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    #7
    Last edited: Jul 24, 2017
  8. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    #8
  9. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    #9
  10. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    #10
  11. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    #11
  12. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    #12
  13. Mr. Bean ✅
    Offline

    Mr. Bean ✅ Member Member

    Joined:
    Mar 3, 2017
    Messages:
    58
    Likes Received:
    5
    There is a issue when a NPC kills a player it pops up with
    (21:19:36) | [IronPython] Error in plugin KillFeed:

    because in the code it doesn't have anywhere for a popup to be shown if a NPC kills a player just if Player kills NPC if it is possible it would be nice if it is added in so I do not get errors all the time if a NPC kills someone :)

    Maybe code should be something like this?
    Code (Python):
    __title__ = 'KillPopup'
    __author__ = 'ice cold'
    __version__ = '1.1.5'

    import clr

    clr.AddReferenceByPartialName("Fougerite")
    import Fougerite
    import re

    class KillFeed:
        Enable = None
        NpcKill = None

        def On_PluginInit(self):
            Util.ConsoleLog( __title__ +" by " + __author__ + " Version: " + __version__ + " loaded.", False)
            ini = self.Settings()
            self.NpcKill = int(ini.GetSetting("Settings", "NpcKill"))
            self.Enable = int(ini.GetSetting("Settings", "Enable"))

        def Settings(self):
            if not Plugin.IniExists("Settings"):
                ini = Plugin.CreateIni("Settings")
                ini.AddSetting("Settings", "NpcKill", "1")
                ini.AddSetting("Settings", "Enable", "1")
                ini.Save()            
            return Plugin.GetIni("Settings")

        def On_Command(self, Player, cmd, args):
            if cmd == "popon":
                DataStore.Add("pop", Player.SteamID, "1")
                Player.Notice("✔", "KillPopup is now Enabled")
                return
            elif cmd == "popoff":
                DataStore.Remove("pop", Player.SteamID)
                Player.Notice("✔", "KillPopup is now Disabled")
                return
            elif cmd == "pop":
                Player.MessageFrom("KillFeed", "/popon - to enable kill popups")
                Player.MessageFrom("KillFeed", "/popoff - Disable kill popups")

        def On_PlayerKilled(self, DeathEvent):
            if self.Enable == 1:
                if DataStore.Get("pop", DeathEvent.Attacker.SteamID):
                    if DeathEvent.AttackerIsPlayer:
                        DeathEvent.Attacker.Notice("☠", "You killed " + DeathEvent.Victim.Name)  
                    else:
                    if DeathEvent.VictimIsPlayer:
                        DeathEvent.Victim.Notice("☠", "You were killed by " + DeathEvent.Attacker.Name)

        def On_NPCKilled(self, DeathEvent):
            if self.NpcKill == 1:
                if DataStore.Get("pop", DeathEvent.Attacker.SteamID):
                   if DeathEvent.AttackerIsPlayer:
                      DeathEvent.Attacker.Notice("☠", "You killed a " + DeathEvent.Victim.Name)
                else:
                if DeathEvent.VictimIsPlayer:
                    DeathEvent.Victim.Notice("☠", "You were killed by " + DeathEvent.Attacker.Name)


     
    I keep on getting indent errors because I am not good at coding, I am just learning but hopefully you get what I mean and can fix it. :)
     
    #13
    Last edited: Apr 29, 2018
  14. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    my sublime text didnt worked as i wanted todo but try this

    Code (Python):
    __title__ = 'KillPopup'
    __author__ = 'ice cold'
    __version__ = '1.1.5'

    import clr

    clr.AddReferenceByPartialName("Fougerite")
    import Fougerite
    import re

    class KillFeed:
        Enable = None
        NpcKill = None

        def On_PluginInit(self):
            Util.ConsoleLog( __title__ +" by " + __author__ + " Version: " + __version__ + " loaded.", False)
            ini = self.Settings()
            self.NpcKill = int(ini.GetSetting("Settings", "NpcKill"))
            self.Enable = int(ini.GetSetting("Settings", "Enable"))

        def Settings(self):
            if not Plugin.IniExists("Settings"):
                ini = Plugin.CreateIni("Settings")
                ini.AddSetting("Settings", "NpcKill", "1")
                ini.AddSetting("Settings", "Enable", "1")
                ini.Save()          
            return Plugin.GetIni("Settings")

        def On_Command(self, Player, cmd, args):
            if cmd == "popon":
                DataStore.Add("pop", Player.SteamID, "1")
                Player.Notice("✔", "KillPopup is now Enabled")
                return
            elif cmd == "popoff":
                DataStore.Remove("pop", Player.SteamID)
                Player.Notice("✔", "KillPopup is now Disabled")
                return
            elif cmd == "pop":
                Player.MessageFrom("KillFeed", "/popon - to enable kill popups")
                Player.MessageFrom("KillFeed", "/popoff - Disable kill popups")

        def On_PlayerKilled(self, DeathEvent):
            if self.Enable == 1:
                if DataStore.Get("pop", DeathEvent.Attacker.SteamID):
                    if DeathEvent.AttackerIsPlayer:
                        DeathEvent.Attacker.Notice("☠", "You killed " + DeathEvent.Victim.Name)
                        return
                    if DeathEvent.VictimIsPlayer:
                        DeathEvent.Victim.Notice("☠", "You were killed by " + DeathEvent.Attacker.Name)

        def On_NPCKilled(self, DeathEvent):
            if self.NpcKill == 1:
                if DataStore.Get("pop", DeathEvent.Attacker.SteamID):
                   if DeathEvent.AttackerIsPlayer:
                       DeathEvent.Attacker.Notice("☠", "You killed a " + DeathEvent.Victim.Name)
                       return
                   if DeathEvent.VictimIsPlayer:                                      
                          DeathEvent.Victim.Notice("☠", "You were killed by " + DeathEvent.Attacker.Name)
     
     
    #14
    • Like Like x 1
  15. Mr. Bean ✅
    Offline

    Mr. Bean ✅ Member Member

    Joined:
    Mar 3, 2017
    Messages:
    58
    Likes Received:
    5
    Good idea and try, but I still get error

    [IronPython] Error in plugin KillFeed:
    Traceback (most recent call last):
    File "<string>", line 44, in On_PlayerKilled
    AttributeError: 'NPC' object has no attribute 'SteamID'

    It still happens when I get killed by a bear or whatever. It still does not show popup only if I kill a animal.
     
    #15
  16. Mr. Bean ✅
    Offline

    Mr. Bean ✅ Member Member

    Joined:
    Mar 3, 2017
    Messages:
    58
    Likes Received:
    5
    Anyone know how to fix this still? Happens when someone gets killed by a animal.

    [5/16/2018 5:53:27 AM] [Error] [IronPython] Error in plugin KillFeed:
    [5/16/2018 5:53:27 AM] [Error] Traceback (most recent call last):
    File "<string>", line 44, in On_PlayerKilled
    AttributeError: 'NPC' object has no attribute 'SteamID'
     
    #16
  17. ice cold
    Offline

    ice cold Plugin Developer Plugin Developer

    Joined:
    Oct 24, 2016
    Messages:
    621
    Likes Received:
    66
    Weird that it does this since i it makes sure the victim and Attacker are players
     
    #17
  18. Jakkee
    Offline

    Jakkee Plugin Developer Plugin Developer Contributor

    Joined:
    Jul 28, 2014
    Messages:
    1,466
    Likes Received:
    149
    Lol...
    You are checking if Victims SteamID is in the datastore BEFORE checking if it’s a player
     
    #18
  19. Mr. Bean ✅
    Offline

    Mr. Bean ✅ Member Member

    Joined:
    Mar 3, 2017
    Messages:
    58
    Likes Received:
    5
    Can you please fix it? Then send me the code or upload it here?
     
    #19
  20. Jakkee
    Offline

    Jakkee Plugin Developer Plugin Developer Contributor

    Joined:
    Jul 28, 2014
    Messages:
    1,466
    Likes Received:
    149
    Code (Python):
    Code (Python):
    __title__ = 'KillPopup'
    __author__ = 'TempFix'
    __version__ = '69.69.69'

    import clr

    clr.AddReferenceByPartialName("Fougerite")
    import Fougerite
    import re

    class KillFeed:
        Enable = None
        NpcKill = None

        def On_PluginInit(self):
            Util.ConsoleLog( __title__ +" by " + __author__ + " Version: " + __version__ + " loaded.", False)
            ini = self.Settings()
            self.NpcKill = int(ini.GetSetting("Settings", "NpcKill"))
            self.Enable = int(ini.GetSetting("Settings", "Enable"))

        def Settings(self):
            if not Plugin.IniExists("Settings"):
                ini = Plugin.CreateIni("Settings")
                ini.AddSetting("Settings", "NpcKill", "1")
                ini.AddSetting("Settings", "Enable", "1")
                ini.Save()          
            return Plugin.GetIni("Settings")

        def On_Command(self, Player, cmd, args):
            if cmd == "popon":
                DataStore.Add("pop", Player.SteamID, "1")
                Player.Notice("✔", "KillPopup is now Enabled")
                return
            elif cmd == "popoff":
                DataStore.Remove("pop", Player.SteamID)
                Player.Notice("✔", "KillPopup is now Disabled")
                return
            elif cmd == "pop":
                Player.MessageFrom("KillFeed", "/popon - to enable kill popups")
                Player.MessageFrom("KillFeed", "/popoff - Disable kill popups")

        def On_PlayerKilled(self, DeathEvent):
            if self.Enable == 1:
                if DeathEvent.AttackerIsPlayer:
                    if DataStore.Get("pop", DeathEvent.Attacker.SteamID):
                        DeathEvent.Attacker.Notice("☠", "You killed " + DeathEvent.Victim.Name)
                        return
                if DeathEvent.VictimIsPlayer:
                    if DataStore.Get("pop", DeathEvent.Victim.SteamID):
                        DeathEvent.Victim.Notice("☠", "You were killed by " + DeathEvent.Attacker.Name)

        def On_NPCKilled(self, DeathEvent):
            if self.NpcKill == 1:
                if DeathEvent.AttackerIsPlayer:
                    if DataStore.Get("pop", DeathEvent.Attacker.SteamID):
                       DeathEvent.Attacker.Notice("☠", "You killed a " + DeathEvent.Victim.Name)
                       return
                if DeathEvent.VictimIsPlayer:
                    if DataStore.Get("pop", DeathEvent.Victim.SteamID):            
                          DeathEvent.Victim.Notice("☠", "You were killed by " + DeathEvent.Attacker.Name)
    Maybe this, idk if there will be any indent errors as I just typed that on my phone
    @Mr. Bean ✅
     
    #20

Share This Page