Results 1 to 4 of 4

Thread: If Then Statments

  1. #1
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default If Then Statments

    I am writing a script and in it i have a procedure that checks the players combat and if it is 3 terminates the script (im sick of level 3 flax pickers). It is called in the set up player procedure and im getting this error:
    Line 33: [Error] (20286:1): Identifier expected in script (Path2Script)
    This is the procedure im getting an error on:
    PHP Code:
    procedure CheckCombat;
    begin
      
    if(GetCombatLevel 3then
       Writeln
    ('Your Combat level is 3 Noob.');
       
    Writeln('Please Raise Your Combat Before Botting');
       
    Writeln('Switching Players - lvl 3s are annoying');
      
    TerminateScript;
      else
      
    Writeln('Combat is higher than 3 - Continuing Script');
      
    Writeln('This procedure is part of anti noob - Feel free to leech');
    end
    Line 33 is else btw.
    So its saying identifier expected at line 33 which is else. Anyone know what im doing wrong?
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

  2. #2
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    procedure CheckCombat;
    begin
      if(GetCombatLevel = 3) then
      begin
        Writeln('Your Combat level is 3 Noob.');
        Writeln('Please Raise Your Combat Before Botting');
        Writeln('Switching Players - lvl 3s are annoying');
        TerminateScript;
      end else begin
        Writeln('Combat is higher than 3 - Continuing Script');
        Writeln('This procedure is part of anti noob - Feel free to leech');
      end;
    end;

  3. #3
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    TerminateScript; without ;

    oh yeah, and begin- ends, since your having more than one line after the if statement.

  4. #4
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks bolth. Its working now.
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

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
  •