Originally Posted by
EvoloZz
Hello, i need help with "self iprintlnbold" command. I want to make something like an automatic welcome message, that when player joins in game it will print some nice welcome message on his screen. I think it goes under Callback_PlayerConnect()
I am newb in this kinda stuff ^^
~EvoloZz
Basically, don't call the function on a connecting player. It's not the best place to use it because as soon as they connect, a menu of some sorts will pop up and block them seeing it. Wait till they spawn, then do your message.
Code:
init()
{
level thread onPlayerConnect();
}
onPlayerConnect()
{
for( ;; )
{
level waittill( "connecting", player );
player.pers[ "welcomed" ] = undefined;
player thread onPlayerSpawned();
}
}
onPlayerSpawned()
{
self endon( "disconnect" );
for( ;; )
{
self waittill( "spawned_player" );
self thread WelcomeMessage();
}
}
WelcomeMessage()
{
self endon( "disconnect" );
if( isdefined( self.pers[ "welcomed" ] ) ) return;
self.pers[ "welcomed" ] = true;
self iprintlnBold( "Hello" );
}