Results 1 to 4 of 4

Thread: Error script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Here you call the function 'randombox' on the list and pass the weapon (with the same index as the box) via the first parameter:

    PHP Code:
    for(i=0;i<randomboxes.size;i++) randomboxes[ithread randombox(randomweaps[i]); 
    Your loop ran out of weapons therefore the variable 'weap' is now undefined (no entity) which results in a script runtime error.

    You can do one of these options:
    • Make sure both lists are the same size.
    • Check randomweaps's size before calling the 'randombox' function.
    Last edited by Mitch; 9th January 2019 at 18:00. Reason: list bbcode

  2. #2
    Private
    Join Date
    Jan 2019
    Posts
    15
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Mitch View Post
    Here you call the function 'randombox' on the list and pass the weapon (with the same index as the box) via the first parameter:

    PHP Code:
    for(i=0;i<randomboxes.size;i++) randomboxes[ithread randombox(randomweaps[i]); 
    Your loop ran out of weapons therefore the variable 'weap' is now undefined (no entity) which results in a script runtime error.

    You can do one of these options:
    • Make sure both lists are the same size.
    • Check randomweaps's size before calling the 'randombox' function.
    if...return fixed this error. thx.
    https://i.imgur.com/0a6oNbP.png

Posting Permissions

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