Reserved name

Discussion in 'Requests' started by Pompeyo, Feb 3, 2018.

  1. Pompeyo
    Offline

    Pompeyo Member Member

    Joined:
    Jan 6, 2018
    Messages:
    50
    Likes Received:
    4
    Formerly I used a lot of this plugin in oxide to control that the players are not changing the name, because in my server they are used to that and it is a bit uncomfortable, I would really appreciate if someone could convert this plugin to python
     

    Attached Files:

    #1
  2. salva
    Offline

    salva Friendly self-taught developer Administrator

    Joined:
    Jan 31, 2016
    Messages:
    564
    Likes Received:
    82
    Hello, it is not necessary to convert ... You just have to make a new one ... it's a good idea, I've already seen it too, if you really need it I'll do it for you next week, regards
     
    #2
    • Winner Winner x 1
    • Friendly Friendly x 1
  3. salva
    Offline

    salva Friendly self-taught developer Administrator

    Joined:
    Jan 31, 2016
    Messages:
    564
    Likes Received:
    82
    #3
  4. Pompeyo
    Offline

    Pompeyo Member Member

    Joined:
    Jan 6, 2018
    Messages:
    50
    Likes Received:
    4
    @salva
    I'll try with that to see if I achieve the result I'm looking for
     
    #4
    • Agree Agree x 1
  5. armand
    Offline

    armand New Member Member

    Joined:
    Jan 5, 2018
    Messages:
    17
    Likes Received:
    2
    #5
    • Winner Winner x 1
  6. Pompeyo
    Offline

    Pompeyo Member Member

    Joined:
    Jan 6, 2018
    Messages:
    50
    Likes Received:
    4
    It really is something that we need !!!
     
    #6
  7. DreTaX
    Offline

    DreTaX Probably knows the answer... Administrator

    Joined:
    Jun 29, 2014
    Messages:
    3,817
    Likes Received:
    602
    If people change their IDs this won't work.

    Code (Python):
    __author__ = 'DreTaX'
    __version__ = '1.0'

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

    purple = "[color #6600CC]"

    class NameSaver:

        def On_PlayerConnected(self, Player):
            if DataStore.Get("NameSaver", Player.UID) is not None:
                Player.Name = DataStore.Get("NameSaver", Player.UID)
                Player.Message(purple + "Your name cannot be different than the one you first joined in with!")
            else:
                DataStore.Add("NameSaver", Player.UID, Player.Name)

        def On_Command(self, Player, command, args):
            if command == "resetname":
                if Player.Admin:
                    if len(args) == 0:
                        Player.Message("/resetname playername")
                        return
                    playername = str.join("", args)
                    pl = Server.FindPlayer(playername)
                    if pl is not None:
                        DataStore.Remove("NameSaver", pl.UID)
                        Player.Message("Name has been reset!")
                    else:
                        Player.Message("Can't find player!")
     
     
    #7
    • Winner Winner x 3
  8. armand
    Offline

    armand New Member Member

    Joined:
    Jan 5, 2018
    Messages:
    17
    Likes Received:
    2
    Thank you very much
     
    #8
  9. Pompeyo
    Offline

    Pompeyo Member Member

    Joined:
    Jan 6, 2018
    Messages:
    50
    Likes Received:
    4
    @DreTaX
    good job, that's exactly what we needed, time to try
     
    #9

Share This Page

iHax Comunity/