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

Thread: Player can't move for secounds

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    Player can't move for secounds

    Hi Guys, i have a question: how i can make that a player can't move for (example) 20 seconds?
    after the 20 seconds he can move?

    If you ask what i want to make:
    The Map is starting, 20 seconds and the game begins

  2. #2
    Private First Class RobsoN's Avatar
    Join Date
    Jan 2013
    Location
    /home/cod2/
    Posts
    230
    Thanks
    119
    Thanked 95 Times in 64 Posts
    link player to script origin:

    To lock:

    org = spawn("script_origin",self.origin);
    self linkTo(org);

    To unlock:
    self unlink();

  3. The Following User Says Thank You to RobsoN For This Useful Post:

    kung foo man (15th June 2013)

  4. #3
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    So you mean: [code]

    org = spawn("script_origin",self.origin);
    self linkTo(org);

    wait(20);

    self unlink();

  5. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    But don't forget to delete the helper-model then. On the other hand you don't need a model for each player, one model for all works also.

    PHP Code:
    // ONLY ONCE:
    level.helper spawn("script_origin", (0,0,0))

    // for each player:
    player linkTo(level.helper);
    wait 20;
    player unlink(); 
    timescale 0.01

  6. #5
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    Hi, this i get it if i have test it:
    Code:
    ******* script compile error *******
    bad syntax: (file 'maps/mp/gametypes/_begin.gsc', line 9)
    self linkTo(level.waiter);
    *
    ************************************
    script:
    Code:
    init()
    {
    thread waiting();
    }
    
    waiting()
    {
    level.waiter = spawn("script_origin", (0,0,0))
    self linkTo(level.waiter);
    wait 20;
    self unlink();  
    }

  7. #6
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    I said with bold text: ONLY ONCE

    If you can't understand that, use:

    PHP Code:
    init()
    {
    thread waiting();
    }

    waiting()
    {
    if ( ! 
    isDefined(level.waiter))
        
    level.waiter spawn("script_origin", (0,0,0)); // you forget the ; here
    self linkTo(level.waiter);
    wait 20;
    self unlink();  

    timescale 0.01

  8. #7
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    hmm it didnt work, i have try to make script_model but it doesnt work too.
    my error:
    Code:
    ******* script runtime error *******
    struct is not an entity: (file 'maps/mp/gametypes/_begin.gsc', line 10)
    self linkTo(level.waiter);
    *

  9. #8
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    You need to call the functions on a player, now the functions work with "level".
    timescale 0.01

  10. #9
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    hmmm idk what you mean ;(

  11. #10
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Try freezecontrols() instead.

Posting Permissions

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