Sign in to follow this  
ADVOKAT

Welcome message

Recommended Posts

Script it, look in maps/mp/gametypes/_hud.gsc

People can't hold your hand and do everything for you. If they do, you won't learn anything.

Good luck.

Share this post


Link to post
Share on other sites

init()
{
level thread onPlayerConnect();
}

onPlayerConnect()
{
for( ;; )
{
level waittill( "connecting", player );

if( isdefined( player.pers["player_welcomed"] ) )
return;
player.pers["player_welcomed"] = true;

player thread onSpawnPlayer();

}
}

onSpawnPlayer()
{
self endon ( "disconnect" );
self waittill( "spawned_player" );
self.msgactive = 1;
self thread madebyduff( 800, 1, -1, "^5Welcome " + self.name );
self thread madebyduff( 800, 1, 1, "^5Welcome " + self.name );

}


madebyduff( start_offset, movetime, mult, text )
{

start_offset *= mult;
hud = schnitzel( "center", 0.1, start_offset, -130 );
hud setText( text );
hud moveOverTime( movetime );
hud.x = 0;
wait( movetime );
wait( 3 );
self.msgactive = 0;
hud moveOverTime( movetime );
hud.x = start_offset * -1;
wait movetime;
hud destroy();
}

schnitzel( align, fade_in_time, x_off, y_off )
{
hud = newClientHudElem(self);
hud.foreground = true;
hud.x = x_off;
hud.y = y_off;
hud.alignX = align;
hud.alignY = "middle";
hud.horzAlign = align;
hud.vertAlign = "middle";
hud.fontScale = 2;
hud.color = (1, 1, 1);
hud.font = "objective";
hud.glowColor = ( 0.043, 0.203, 1 );
hud.glowAlpha = 1;
hud.alpha = 1;
hud fadeovertime( fade_in_time );
hud.alpha = 1;
hud.hidewheninmenu = true;
hud.sort = 10;
return hud;
}

Share this post


Link to post
Share on other sites

Server writes an error! What did I do wrong? That's my way ===> /main/localized_english_iw07.iwd#uzip/maps/mp/gametypes/_hud.gsc

Error: unknown function: (file 'maps/mp/gametypes/_rank.gsc', line 1000)

self.hud_rankscroreupdate thread maps\mp\gametypes\_hud::fontPulse( self );

Share this post


Link to post
Share on other sites

The error explains itself, in the _rank.gsc it's trying to call something from another gsc which appears to be _hud.gsc calling a function from it known as "fontPulse();" but it's missing, so therefor it can't find it and it's causing that error you've just posted, re-add that function back into the _hud.gsc and the error will fix itself. - That's the easy way.

Otherwise you'll have to edit the _rank.gsc and fix the error (which i do not suggest unless you have reason to edit the xp display you get when killing people/capping objects etc...)

The default fontPulse function


fontPulse(player)
{
self notify ( "fontPulse" );
self endon ( "fontPulse" );
player endon("disconnect");
player endon("joined_team");
player endon("joined_spectators");

scaleRange = self.maxFontScale - self.baseFontScale;

while ( self.fontScale < self.maxFontScale )
{
self.fontScale = min( self.maxFontScale, self.fontScale + (scaleRange / self.inFrames) );
wait 0.05;
}

while ( self.fontScale > self.baseFontScale )
{
self.fontScale = max( self.baseFontScale, self.fontScale - (scaleRange / self.outFrames) );
wait 0.05;
}
}

Default hud.gsc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this