Results 1 to 5 of 5

Thread: Prevent duplicated names

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Ni3ls View Post
    Do you have documentation of "CodeCallback_userinfochanged"?
    CodeCallback_UserInfoChanged is called every time the 'userinfo' text has been changed (including your name) and is called before changing the client's user info data.
    So 'self.name' is updated after executing the function clientuserinfochanged().

    PHP Code:
    CodeCallback_UserInfoChanged(clientNum)
    {
        
    oldname self.name// 'userinfo' text has not been processed yet.
        
    name self get_userinfo("name"); // Get player's name from the updated 'userinfo' text.

        // Edit: 
        // Like IzNoGod said: check for name duplication here and restore the old name using renameclient(oldname) in case needed.

        
    self clientuserinfochanged(); // Update the client's user info data.

    Last edited by Mitch; 31st July 2017 at 17:17.

  2. The Following User Says Thank You to Mitch For This Useful Post:

    Ni3ls (31st July 2017)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •