PDA

View Full Version : welcome script



warrior
22nd May 2018, 21:48
...........

Tally
23rd May 2018, 00:26
Callback_PlayerConnect()
{
....
self setClientCvar("g_scriptMainMenu", scriptMainMenu);

self.message_done = undefined;

self thread welcomeMessage();
}

welcomeMessage()
{
if( isDefined( self.message_done ) )
return;
self.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:)");

}


That will show the messages once, and once only.

warrior
23rd May 2018, 04:41
Thank you very much, Tally!
this was so helpful!

IzNoGoD
23rd May 2018, 04:49
@Tally: The OP is talking about SD gametype, so it might be wise to store the check in a .pers array var.

warrior
23rd May 2018, 05:09
Hey, this work only if you go to spectate and join back, but at the half of the time, when you switch teams, it appears again :/

Tally
23rd May 2018, 09:45
@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:


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:)");

}

warrior
23rd May 2018, 17:16
Bf, it doesn't work... it appears after Half-Time... I've tried everything possible. Goddamn it

IzNoGoD
23rd May 2018, 18:12
Thanks for the heads-up. I didn't see the bit about SD gametype.

So, this instead:


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.