Results 1 to 14 of 14

Thread: Procedure SetUserNicks(Active: Boolean);

  1. #1
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Procedure SetUserNicks(Active: Boolean);

    Well, I have decided to post this procedure in this section as well as the SRL Members section because I want more people to use it!

    This is the thread in the "SRL New Functions" section (SRL Members only):
    Procedure SetUserNicks(Active: Boolean);

    This procedure sets the user nicks for you! If "active" is false, the characters in which nicks can not be made from their usernames(ex: la la la), will become non-active (Players[].Active:=False). If "active" is true, they will remain active, even if a nick name can not be created.

    I dont know if this has already been made, so let me no if it has.

    SCAR Code:
    {*******************************************************************************
    Procedure SetUserNicks(Active: Boolean);
    By: Macrosoft
    Description: Will set the nickname for all the players in your script.  If Active is set as false,
    then if a player's username cannot be used to make a nickname, the player will become not active.
    *******************************************************************************}

     
    Procedure SetUserNicks(Active: Boolean);
     
    var
      counter: integer;
      n, a, x, NameLength: integer;
      cName: array of char;
      nName: array[0..2] of char;
    begin
      a:=GetArrayLength(Players);
      for n:= 0 to a-1 do
        begin
          Counter:=2;
          x:=0
          NameLength:=Length(Players[n].Name);
          SetArrayLength(cName, NameLength + 1);
          repeat
            begin
              cName[Counter-1]:=StrGet(Players[n].Name, Counter);
              if(cName[Counter-1] = ' ')then
              begin
                x:=0;
                Counter:=Counter+1;
              end else
              begin
                nName[x]:=cName[Counter-1];
                x:=x+1;
              end;
              Counter:=Counter+1;
            end;
          until(Counter=NameLength + 2) or (x=3);
          if(Counter=NameLength + 2)then
          begin
            writeln('Nickname can not be made from the username: ' + Players[n].Name);
            if(Active=False) then
            begin
              writeln(Players[n].Name + ' is no longer active');
              Players[n].Active:=False;
            end;
          end else
          begin
            Players[n].Nick:= nName[0] + nName[1] + nName[2];
            writeln(Players[n].Name +#39+ 's nickname has been set to: ' + Players[n].Nick);
          end;
        end;
    end;

    Feel free to use this but remember to Credit Me!

    Give Me Feedback!

  2. #2
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    I don't understand

    But what is this accidentally sets your nick with a captial letter?


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  3. #3
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    The Cow made a script like this... Must be somewhere ^^.
    Verrekte Koekwous

  4. #4
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hy71194 View Post
    I don't understand

    But what is this accidentally sets your nick with a captial letter?
    look at the code, it wont

    if there is a space, x will be set to 0 and the next char will be skipped

  5. #5
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    The Cow made a script like this... Must be somewhere ^^.
    It is Mad Cow

    Yeah, something like this was in SB100's powerskillz. Nice code though, good job.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  6. #6
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks, hope this goes into srl, its really useful (stupid leechers dont know how to set a nick)

  7. #7
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by Macrosoft View Post
    thanks, hope this goes into srl, its really useful (stupid leechers dont know how to set a nick)
    Then they should not auto.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  8. #8
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    agreed...


    comments on procedure?

  9. #9
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice procedure!, i like it
    and a nice piece of code

  10. #10
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks

  11. #11
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    dont you love how my scripts always get so many views, yet such little feedback?

  12. #12
    Join Date
    Sep 2007
    Posts
    28
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok so let me get this straight
    this procedure automatically set your nickname?


  13. #13
    Join Date
    Jul 2007
    Posts
    80
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice coding. I really don't think that people who don't have the time to learn how to set their own nickname should really be spoon fed the answers though =\
    Still, nice procedure.

  14. #14
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by wearenot View Post
    ok so let me get this straight
    this procedure automatically set your nickname?
    yep

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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