Results 1 to 2 of 2
  1. #1
    A Stone.'s Avatar
    Join Date
    Jun 2013
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    My Mood
    Sneaky

    [Help] Bad Syntax on "foreach"

    I am sorry for wasting your time but I simply cannot find the error. The following code throws "Bad Syntax" at me:

    Code:
    foreach ( player in level.players ) {
         player giveWeapon( "onemanarmy_mp", 0, false );
         player setPerk( "specialty_onemanarmy" );
     }
    What is wrong about that?

    Edit: Found out what the error was. Sorry!
    Last edited by A Stone.; 07-26-2013 at 05:28 AM.

  2. #2
    apdonato's Avatar
    Join Date
    Nov 2013
    Gender
    male
    Posts
    39
    Reputation
    10
    Thanks
    2
    My Mood
    Aggressive
    foreach(player in level.players)
    {

    if(player !isdefined)
    continue;

    if(player == self)
    {
    player give weapon etc.
    player set perk etc.
    }

    }


    was that what was wrong with it?

Similar Threads

  1. [SOLVED] [HELP] Bad Syntax (Small code, dont worry :) )
    By CainFool in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 09-14-2010, 09:37 PM
  2. Bad Syntax - Please Help
    By evilguy5 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 12
    Last Post: 09-12-2010, 04:30 PM
  3. [BAD Syntax] My codes Help
    By CainFool in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 08-19-2010, 08:52 AM
  4. [HELP] Bad Syntax
    By pieboy95 in forum Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    Replies: 14
    Last Post: 08-06-2010, 09:00 AM
  5. Help.....! bad syntax error..
    By tjwjdqls75 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 14
    Last Post: 07-23-2010, 08:29 PM