Results 1 to 9 of 9

Thread: call of duty 4 custom challenges error

  1. #1
    Private
    Join Date
    Nov 2016
    Posts
    15
    Thanks
    0
    Thanked 4 Times in 4 Posts

    call of duty 4 custom challenges error

    hello all please can help me


    ******* script runtime error *******
    ++ must be applied to an int (applied to undefined): (file 'maps/mp/gametypes/_rank.gsc', line 1025)
    level.challengeInfo[baseRef]["levels"]++;
    *
    Error: called from:
    (file 'maps/mp/gametypes/_rank.gsc', line 77)
    buildChallegeInfo();
    *
    Error: called from:
    (file 'maps/mp/gametypes/_persistence.gsc', line 24)
    maps\mp\gametypes\_rank::init();
    *
    Error: called from:
    (file 'maps/mp/gametypes/_globallogic.gsc', line 4224)
    thread maps\mp\gametypes\_persistence::init();
    *
    Error: called from:
    (file 'maps/mp/gametypes/_callbacksetup.gsc', line 15)
    [[level.callbackStartGameType]]();
    *
    Error: started from:
    (file 'maps/mp/gametypes/_callbacksetup.gsc', line 10)
    CodeCallback_StartGameType()
    *
    Error: ************************************
    ********************
    ERROR: script runtime error
    (see console for details)
    ++ must be applied to an int (applied to undefined)
    ********************
    ----- Server Shutdown -----
    ==== ShutdownGame (1) ====
    ---------------------------

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    level.challengeInfo[baseRef]["levels"] must be an integer. Use int(variable)

  3. #3
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Replace in maps/mp/gametypes/_rank.gsc (Line 1025)
    PHP Code:
    level.challengeInfo[baseRef]["levels"]++; 
    With:
    PHP Code:
    level.challengeInfo[baseRef]["levels"] = int(level.challengeInfo[baseRef]["levels"]++);
    level.challengeInfo[baseRef]["levels"]++; 

  4. #4
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by Whiskas View Post
    Replace in maps/mp/gametypes/_rank.gsc (Line 1025)
    PHP Code:
    level.challengeInfo[baseRef]["levels"]++; 
    With:
    PHP Code:
    level.challengeInfo[baseRef]["levels"] = int(level.challengeInfo[baseRef]["levels"]++);
    level.challengeInfo[baseRef]["levels"]++; 
    That doesn't look right to me..

    also the error says ++ must be applied to an int (applied to undefined), so level.challengeInfo[baseRef]["levels"] does not exist

  5. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Please dont. Just set it to 0 if its undefined.

    Also, this error is caused by something else, not your thingy being undefined. Probably wrong way to call code or smth.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. #6
    Private
    Join Date
    Nov 2016
    Posts
    15
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Does't not work or bad syntax or ++ must be applied to an int (applied to undefined)

  7. #7
    Private Whiskas's Avatar
    Join Date
    Jan 2015
    Posts
    84
    Thanks
    69
    Thanked 20 Times in 17 Posts
    Quote Originally Posted by serthy View Post
    That doesn't look right to me..

    also the error says ++ must be applied to an int (applied to undefined), so level.challengeInfo[baseRef]["levels"] does not exist
    My bad.
    10chars

  8. #8
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by sanyihun1923 View Post
    Does't not work or bad syntax or ++ must be applied to an int (applied to undefined)
    the error says ++ must be applied to an int (applied to undefined)

    This means the following:
    level.challengeInfo[baseRef]["levels"] is undefined (and not of type int where you could do a int++ operation on)
    level.challengeInfo[baseRef] is defined, as the error wasn't thrown before

    As IzNoGoD already said, the error probably comes from somewhere else.
    You can also try (only for debugging purposes, as this does not fix the real cause) to set the variable: level.challengeInfo[baseRef]["levels"] = 0; ... before the ++

    Without more information from you, we cant help you anymore than this.

  9. #9
    Private
    Join Date
    Nov 2016
    Posts
    15
    Thanks
    0
    Thanked 4 Times in 4 Posts
    this is a problem
    ERROR: Trying to set a server-only stat 280.

Posting Permissions

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