ItsMods

Full Version: S&D Welcome message only once (no repeating)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi every one, i create my own greeting code for Registered players, but it works every round. Is there any way to make it work only once at 1st spawn or at 1st round.
i was try put it on
OnplayerSpawned - doesnt work at all
Onplayerconnect - no
Onjoinedteam - every round

Someone told me that i should searrch on gamelogic.gsc for the moment when new map start and timer countdowning 15 seconds till some enemy joined to team. but i didnt found. do you guys know haw to solve this problem? Thank you for attention.
Add something like this onplayerconnect(); (you actually can't use a normal self.babla or player.blabla variable. It will get re-initalized every round start.)


Code:
        //initializes message variable
        if( !isDefined( player.pers[ "info_shown" ] ) )
            player.pers[ "info_shown" ] = 0;
            
        //on first connect open info message
        if( isDefined( player.pers[ "info_shown" ] ) && !player.pers[ "info_shown" ] )
            player thread showInfo();

And add a
Code:
self waittill( "joined_team" );
to the showInfo(); thread, so that it looks similar to this:

Code:
showInfo()
{
    self endon("disconnect");
    
    self waittill( "joined_team" );
    
    self.pers[ "info_shown" ] = 1;
    
    //text and other stuff here
}
i have to say it works! Thank You.