Results 1 to 3 of 3

Thread: Script should work

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

    Script should work

    Hello Guys, i have the script finished.
    But it doesn't work.
    Here the script:

    tdm.gsc
    Code:
    Callback_StartGameType()
    	thread counter();
    Code:
    Callback_PlayerConnect()
    {
    	thread dummy();
    
    	self.statusicon = "hud_status_connecting";
    	self waittill("begin");
    	self.statusicon = "";
    	self thread freezeMe();
    
    .....
    }
    And down of the all scripts in tdm.gsc:
    Code:
    counter()
    {
    	level.counter = 20;
    	while(level.counter > 0)
    		{
    			wait 1;
    			level.counter--;
    		}
    }
    
    freezeMe()
    	{
    		self endon("disconnect");
    		if(level.counter > 0) {
    		self freezecontrols(true);
    		self thread unfreezeMe();
    				}
    	}
    
    unfreezeMe()
    	{
    		self endon("disconnect");
    		wait level.counter;
    		self freezecontrols(false);
    	}
    Now if the gametype starts, it will call the thread counter.
    This give it a time and go down after a secound.
    if somebody connect it will read which secound he is and he will freeze.

    But nothing will happend. Somebody know why?

    Thanks

  2. #2
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    113
    Thanks
    10
    Thanked 74 Times in 45 Posts
    PHP Code:
    startGametype()
    {
        
    level.freeze true;
        
    wait level.counter;
        
    level.freeze false;
    }

    spawnPlayerThread()
    {
        
    self endon("disconnect");
        
    self endon("killed_player");

        
    onlyonce true;

        for (;;)
        {
            if (
    level.freeze)
            {
                
    self freezeControls(true);
            }
            else if (
    onlyonce)
            {
                
    onlyonce false;
                
    self freezeControls(false);
                break;
            }

            
    wait 1;
        }


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

    kung foo man (16th June 2013)

  4. #3
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Loveboy View Post
    Hello Guys, i have the script finished.
    But it doesn't work.
    Here the script:

    tdm.gsc
    Code:
    Callback_StartGameType()
    	thread counter();
    Code:
    Callback_PlayerConnect()
    {
    	thread dummy();
    
    	self.statusicon = "hud_status_connecting";
    	self waittill("begin");
    	self.statusicon = "";
    	self thread freezeMe();
    
    .....
    }
    And down of the all scripts in tdm.gsc:
    Code:
    counter()
    {
    	level.counter = 20;
    	while(level.counter > 0)
    		{
    			wait 1;
    			level.counter--;
    		}
    }
    
    freezeMe()
    	{
    		self endon("disconnect");
    		if(level.counter > 0) {
    		self freezecontrols(true);
    		self thread unfreezeMe();
    				}
    	}
    
    unfreezeMe()
    	{
    		self endon("disconnect");
    		wait level.counter;
    		self freezecontrols(false);
    	}
    Now if the gametype starts, it will call the thread counter.
    This give it a time and go down after a secound.
    if somebody connect it will read which secound he is and he will freeze.

    But nothing will happend. Somebody know why?

    Thanks
    It doesn't work because you are freezing a player who hasn't spawned. You are doing it on a player who has just connected. I told you this already - player's who haven't spawned can't use their movement keys, so there is no point using freezeControls() on them. You have to do it on a SPAWNED PLAYER.

Posting Permissions

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