Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
S&D Welcome message only once (no repeating)
#1
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.
Reply

#2
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
}
[Image: lxkf2.jpg]
Reply

#3
i have to say it works! Thank You.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Spawn Message Playing on Respawn? Killjoy 7 5,231 07-11-2013, 14:53
Last Post: Killjoy
  [News] Message from Gabe to Steam Community d0h! 8 5,616 04-05-2013, 18:16
Last Post: SuperNovaAO
  Help timer/message for flags hillbilly 31 14,646 01-20-2013, 18:20
Last Post: [Z00MBY] Alex
  [Request] Different message per map hillbilly 6 3,777 12-22-2012, 20:55
Last Post: hillbilly
  [HELP] pm's message korsika 1 2,072 12-15-2012, 13:13
Last Post: Ich1994
  Chat Message The Tronuo 8 5,017 11-12-2012, 18:05
Last Post: Nekochan
  Health,regenerate, and message changes help mbakerinnv 4 3,490 11-02-2012, 18:12
Last Post: mbakerinnv
  Can I add the first blood message from infected to another gametype? NooB_StalkeR 0 1,726 07-12-2012, 04:21
Last Post: NooB_StalkeR
  plugin message kpoviv 1 1,943 07-08-2012, 17:24
Last Post: JariZ
  message central kpoviv 2 2,056 07-08-2012, 03:55
Last Post: JariZ

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.