Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32

Thread: Timed Door

  1. #11
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    There is a sticky that says when asking about errors always post the code. We can't see what the error is unless you post your code. We are not mind readers.

  2. #12
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    Well, here it is:

    ******script compile error******
    bad syntax: (file 'maps/mp/castle.gsc', line 15
    }
    *
    ***********************************
    And script is:
    main()
    {
    door1= getent("lol1","targetname");
    door2= getent("lol2","targetname");
    t=0;

    while(1)
    {
    if(t==10)
    {
    door1 rotateyaw(90,2);
    door2 rotateyaw(-90,2);
    door2 waittill("rotatedone");
    iPrintInBold("Castle Opened!")
    }
    t++;
    wait 10;
    }
    }

  3. #13
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Code:
    iPrintInBold("Castle Opened!")
    Missing the ";"

  4. #14
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Code:
    main()
    {
    	door1= getent( "lol1", "targetname" );
    	door2= getent( "lol2", "targetname" );
    	t = 0;
    
    	while( true )
    	{
    		if( t == 10 )
    		{
    			door1 rotateyaw( 90, 2 );
    			door2 rotateyaw( -90, 2 );
    			door2 waittill( "rotatedone" );
    			iPrintInBold( "Castle Opened!" );
    		}
    		
    		t++;
    		
    		wait 10;
    	}
    }
    You do know that once the doors are open, the loop will carry on? The doors will keep rotating their yaw again and again and again. If you only want them to open once, you need to break from the loop once done.
    Last edited by Tally; 7th March 2014 at 20:17.

  5. #15
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    Quote Originally Posted by Tally View Post
    Code:
    main()
    {
    	door1= getent( "lol1", "targetname" );
    	door2= getent( "lol2", "targetname" );
    	t = 0;
    
    	while( true )
    	{
    		if( t == 10 )
    		{
    			door1 rotateyaw( 90, 2 );
    			door2 rotateyaw( -90, 2 );
    			door2 waittill( "rotatedone" );
    			iPrintInBold( "Castle Opened!" );
    		}
    		
    		t++;
    		
    		wait 10;
    	}
    }
    You do know that once the doors are open, the loop will carry on? The doors will keep rotating their yaw again and again and again. If you only want them to open once, you need to break from the loop once done.
    Just do
    Code:
    main()
    {
    	door1 = getent( "lol1", "targetname" );
    	door2 = getent( "lol2", "targetname" );
    
    	wait(60 * 10);
    	door1 rotateyaw( 90, 2 );
    	door2 rotateyaw( -90, 2 );
    	door2 waittill( "rotatedone" );
    	iPrintInBold( "Castle Opened!" );
    }
    Waaay less complicated and doesn't involve any loops.

  6. #16
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    Yuri, it says that the line 10, which is the:
    PHP Code:
    main()
    {
        
    door1 getent"lol1""targetname" );
        
    door2 getent"lol2""targetname" );

        
    wait(60 10);
        
    door1 rotateyaw90);
        
    door2 rotateyaw( -90);
        
    door2 waittill"rotatedone" );
        
    iPrintInBold"Castle Opened!" );

    That the iPrintInBold is invalid, with

    PHP Code:
    *********************
    script compile error

    maps
    /mp/castle.gscline 10

    *
    ********************* 

  7. #17
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    But i deleted it, and it works then so

  8. #18
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    But this does not open my doors at all. i can post some screenshots if you want

  9. #19
    Private First Class YuriJurek's Avatar
    Join Date
    Jun 2013
    Posts
    219
    Thanks
    152
    Thanked 88 Times in 47 Posts
    See the error is someone posted it with an I instead of L "iPrintlnBold" try that:
    Code:
    iprintLnbold( "castle opened!" );
    It was upper case i and not L lower in that place.

  10. #20
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    Okey. But I'm getting help from Roman, Yuri

Posting Permissions

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