Results 1 to 8 of 8

Thread: welcome script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by IzNoGoD View Post
    @Tally: The OP is talking about SD gametype, so it might be wise to store the check in a .pers array var.
    Thanks for the heads-up. I didn't see the bit about SD gametype.

    So, this instead:

    Code:
    Callback_PlayerConnect()
    {
    ....
    	self setClientCvar("g_scriptMainMenu", scriptMainMenu);
    	
    	self.pers["message_done"] = undefined;
    	
    	self thread welcomeMessage();
    }
    
    welcomeMessage()
    {
    	if( isDefined( self.pers["message_done"] ) )
    		return;
    	self.pers["message_done"] = true;
    	
    	self endon( "disconnect" );
    	self endon( "death" );
    
    	self waittill("spawned_player");
    
    	self iprintlnbold("^4D^7obrodosli na  ^4W^7a^4RR^7io^4R^7s BigJump ^7SERVER " + self.name + " ^4!"); 
            wait 3;
    	self iprintlnbold("^4L^7ijepo ^4s^7e ^4z^7abavite");
            wait 3;
    	self iprintlnbold("^4P^7osjetite ^4n^7as ^4o^7pet ^4:)");
    
    }

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by Tally View Post
    Thanks for the heads-up. I didn't see the bit about SD gametype.

    So, this instead:

    Code:
    Callback_PlayerConnect()
    {
    ....
    	self setClientCvar("g_scriptMainMenu", scriptMainMenu);
    	
    	self.pers["message_done"] = undefined;
    	
    	self thread welcomeMessage();
    }
    
    welcomeMessage()
    {
    	if( isDefined( self.pers["message_done"] ) )
    		return;
    	self.pers["message_done"] = true;
    	
    	self endon( "disconnect" );
    	self endon( "death" );
    
    	self waittill("spawned_player");
    
    	self iprintlnbold("^4D^7obrodosli na  ^4W^7a^4RR^7io^4R^7s BigJump ^7SERVER " + self.name + " ^4!"); 
            wait 3;
    	self iprintlnbold("^4L^7ijepo ^4s^7e ^4z^7abavite");
            wait 3;
    	self iprintlnbold("^4P^7osjetite ^4n^7as ^4o^7pet ^4:)");
    
    }
    Even with that, onconnect is called during the fast_restart used to go to next round/halftime. Might wanna remove the = undefined thing in there. It's undefined by default, when a client connects. Set it on first spawn, then never touch it again.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

Posting Permissions

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