Results 1 to 4 of 4

Thread: Pascal to Lape help

  1. #1
    Join Date
    Apr 2007
    Location
    Estonia
    Posts
    156
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default Pascal to Lape help

    Hey, used to use it with Pascal Interpreter, now with Lape can't get it to work, can someone help me? Ty

    Simba Code:
    program R_GetPlayers_TEST;
    {$DEFINE SMART}
    {$i AeroLib/AeroLib.Simba}
    {$i Reflection/Reflection.Simba}


    type
      TPlayer2 = record
      Name: String;
      Level: Integer;
    end;

      TPlayerArray = Array of TPlayer2;

    function R_GetPlayers: TPlayerArray;
    var
      amount,I, J, _Count, _Player, _Name, _Level: Integer;
      Tp: Tpoint;
    begin
      _Count := SmartGetFieldArraySize(SmartCurrentTarget, 0, 'client.ga', 0);
      SetLength(Result, J);
      for I := 0 to _Count - 1 do begin
        _Player := SmartGetFieldArrayObject(SmartCurrentTarget, 0, 'client.ga', I);
        if (_Player <= 0) then
          Continue;
        Inc(J);

        SetLength(Result, J);
      end;
        amount := J-1; // subtract yourslef
    end;

    begin
      initAL;
      Reflect.Setup;
      repeat
        R_GetPlayers();
        Writeln('There are currently '+tostr(amount)+' players');
        wait(1000);
      until(false);
    end.
    ROCK IS NOT A DEVILS WORK, ITS MAGICAL AND RAD!

  2. #2
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Whats not working? Just seems like you need to look at the lape include and fix the script accordingly

  3. #3
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    First glance I noticed that you are using amount in your mainloop, but it is scoped to the R_GetPlayers function.

  4. #4
    Join Date
    Apr 2007
    Location
    Estonia
    Posts
    156
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    Ahh, SmartCurrentTarget is Reflect.Smart.Target now -.- Got it to work now, ty for answering
    ROCK IS NOT A DEVILS WORK, ITS MAGICAL AND RAD!

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
  •