Results 1 to 15 of 15

Thread: AddPlayer() Function

  1. #1
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default AddPlayer() Function

    I was making my agility course runner (all others suck, sorry) and made some functions.

    I think that AddPlayer() would be a good addition to SRL.

    Here is source (I whipped it up in ~10 seconds, so it is crummy):
    SCAR Code:
    procedure DeclarePlayer(username, password, nick: string; active: boolean);
    begin
       HowManyPlayers := GetArrayLength(Players) + 1;
       NumberOfPlayers(HowManyPlayers);

       Players[GetArrayLength(Players) + 1].Name := username;
       Players[GetArrayLength(Players) + 1].Pass := password;
       Players[GetArrayLength(Players) + 1].Nick := nick;
       Players[GetArrayLength(Players) + 1].Active := active;

       WriteLn('Added player number ' + IntToStr(GetArrayLength(Players) + 1) + ', ' + username + '.');
    end;

    Would this make a useful addition?
    Or are people used to doing this manually...

    Thanks!
    Last edited by Blender; 06-21-2009 at 11:46 AM.
    PM me if you need any help with math.
    I can try to help you with anything!


  2. #2
    Join Date
    May 2007
    Location
    Sydney, Australia (Faggot Region)
    Posts
    1,465
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Seems ok to me good work.
    you might want to
    Code:
    [highlight=pascal]


  3. #3
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Pascal highlighting is different than SCAR...but I do not think that this is a good idea. Sorry.

  4. #4
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    Pascal highlighting is different than SCAR...but I do not think that this is a good idea. Sorry.
    Not a good idea on whose part?
    PM me if you need any help with math.
    I can try to help you with anything!


  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The function...

  6. #6
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    uhhh ... how does it know what player to add? ... :S

  7. #7
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You use it like AddPlayer('user', 'pass', 'nick', true);
    It increments the player array each time a player is added.
    PM me if you need any help with math.
    I can try to help you with anything!


  8. #8
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    I thunk this would only really be useful for armies.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  9. #9
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Err, I don't find a use for this. Players are set up at the beginning of every script so there would be no need for another player.


  10. #10
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    1,124
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Well if your going to set it up using addplayer(); then why not just set it up in declareplayers in the first place ..?

  11. #11
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Maybe while you're running an 70 hour script and you want to add a player to the player array, or something?
    ~Hermen

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

    Default

    Useful in combination with RC?
    Verrekte Koekwous

  13. #13
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Useful in combination with RC?
    Thats what I was thinking

  14. #14
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    It would need parameters like the SRL Player Form though.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  15. #15
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Should be good for RC IMO.
    I probably won't be using it though.



    ~NS

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
  •