Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: AssertMsg

  1. #1
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts

    AssertMsg

    PHP Code:
     if(self.pers["team"] == team)
        {
            
    AssertMsg("Moving "+self.name" to same team! "+team);
            
    iprintln("Moving "+self.name" to same team! "+team);
            return;
        }
    [
    18:24RobsoN: and i need to check where is my script calledbecause i don't know why my script is switching team twice
    [18:25] RobsoN: so i wanted to use assertmsg to get the call info
    [18:25] RobsoN: and i can see iprintln in console, but no errors from assertmsg 
    Im on developer 1, logfile 1.
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    You need to actually throw an error before it will print:

    assertmsg( <message> )


    ModuleDebug


    Summary

    throws a script error with the given message



    Example

    assertmsg ( "There is no enemy is sight!!" );
    Last edited by Tally; 17th October 2013 at 17:07.

  3. #3
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    I'm sorry but I can't understand
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  4. #4
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    fires script error:

    assert( false );
    assertEx( false , "ERROR" );
    assertMsg( true , "ERROR" );

    everything OK:

    assert( true );
    assertEx( true , "ERROR" );
    assertMsg( false , "ERROR" );
    Last edited by serthy; 17th October 2013 at 17:52.

  5. The Following 2 Users Say Thank You to serthy For This Useful Post:

    kung foo man (17th October 2013),Ni3ls (18th October 2013)

  6. #5
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    None of them work .
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  7. #6
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Then youre not in developer mode.

  8. #7
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    Im in.
    PHP Code:
    ]developer
    "developer" is"2" default: "0"
      
    Domain is any integer from 0 to 2 
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  9. #8
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    my startparameters:
    CoD2MP_s.exe +set dedicated 2 +set fs_game serthywars_002 +exec server.cfg +set developer 1

    tested and everything is running just fine

  10. #9
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    Which version of CoD are you running?
    "Don't worry if your code doesn't work correctly - if everything worked, you would not work" ~Mosher's right

  11. #10
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    10characters 1.2

Posting Permissions

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