Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Help] Show Player Name on Join

Опубликовано:

How would I make a welcome message that would display "Welcome *playername*, Have fun!" just on their screen. I just need the code to display a player's name. I couldn't find it.

Featured Replies

Опубликовано:

It's not working. here's the code

 

		showExistence3 = player createFontString( "arial", 2 );
	showExistence3 setPoint( "CENTER", "TOP", 0, 16 );
	showExistence3 setText( "self.name ^6<3" );

Опубликовано:
It's not working. here's the code

 

	showExistence3 = player createFontString( "arial", 2 );
	showExistence3 setPoint( "CENTER", "TOP", 0, 16 );
	showExistence3 setText( self.name + "^6<3" );

 

Try that maybe? :S

Опубликовано:

.-.

 

self thread TextPopup8("^2Welcome^7 " + self.name + " to blablablabala");

 

TextPopup8( text )
{
self endon( "disconnect" );
wait ( 0.05 );
self.textPopup8 destroy();
self notify( "textPopup8" );
self endon( "textPopup8" );
self.textPopup8 = newClientHudElem( self );
self.textPopup8.horzAlign = "center";
self.textPopup8.vertAlign = "top";
self.textPopup8.alignX = "center";
self.textPopup8.alignY = "top";
self.textPopup8.x = 40;
self.textPopup8.y = 20;
self.textPopup8.font = "hudbig";
self.textPopup8.fontscale = 0.75;
self.textPopup8.color = (25.5, 25.5, 3.6);
self.textPopup8 setText(text);
self.textPopup8.alpha = 0.85;
self.textPopup8.glowColor = (0.3, 0.3, 0.9);
self.textPopup8.glowAlpha = 0.55;
   wait 0.1;
self.textPopup8 ChangeFontScaleOverTime( 0.1 );
self.textPopup8.fontScale = 0.69;	
switch(randomInt(2))
{
    case 0:
	self.textPopup8 moveOverTime( 5.00 );
	self.textPopup8.x = 100;
	self.textPopup8.y = -30;
	break;
	case 1:
	self.textPopup8 moveOverTime( 5.00 );
	self.textPopup8.x = -100;
	self.textPopup8.y = -30;
	break;
}
wait 1;
self.textPopup8 fadeOverTime( 3.00 );
self.textPopup8.alpha = 0;
}

 

I take no Credits for the Text - It was coded by the creators of AI zombie mod.

Опубликовано:

Nope, not working. I'm Using the Roll The Dice mod if that makes a difference.

Опубликовано:
Nope, not working. I'm Using the Roll The Dice mod if that makes a difference.

 

are you even calling the thread? if so where?

 

Edit: also i don't think there is a Arial font in MW2 correct me if im wrong... :?

Опубликовано:

Thats the entire code for it to print things at the top

 

Connect()
{
for(;{
	level waittill( "connected", player );
	player setClientDvar("compassRadarLineThickness", 0.001);
	player setClientDvar("compassRadarPingFadeTime", 0.1);
	player setClientDvar("compassRadarUpdateTime", 9999);
	player thread Spawned();


	showExistence = player createFontString( "arial", 1 );
	showExistence setPoint( "CENTER", "TOP", 0, 41 );
	showExistence setText( "www.youtube.com" );
	showExistence.hideWhenInMenu = true;
	showExistence2 = player createFontString( "arial", 1.3 );
	showExistence2 setPoint( "CENTER", "TOP", 0, 32 );
	showExistence2 setText( "^1Have Fun! ^6<3" );
	showExistence2.hideWhenInMenu = true;
	showExistence3 = player createFontString( "arial", 2 );
	showExistence3 setPoint( "CENTER", "TOP", 0, 8 );
     		showExistence3 setText("^2Welcome,^7 " + self.name + " ^6<3");
	showExistence3.hideWhenInMenu = true;

	RTDExistence = player createFontString( "arial", 1.3 );
	RTDExistence setPoint( "Center", "TOP", 0, 22 );
	RTDExistence setText( "^1Roll The Dice v5.5 Edited By Seen|Render" );
	RTDExistence.hideWhenInMenu = true;
}
}

Опубликовано:
Thats the entire code for it to print things at the top

 

Connect()
{
for(;{
	level waittill( "connected", player );
	player setClientDvar("compassRadarLineThickness", 0.001);
	player setClientDvar("compassRadarPingFadeTime", 0.1);
	player setClientDvar("compassRadarUpdateTime", 9999);
	player thread Spawned();


	showExistence = player createFontString( "arial", 1 );
	showExistence setPoint( "CENTER", "TOP", 0, 41 );
	showExistence setText( "www.youtube.com" );
	showExistence.hideWhenInMenu = true;
	showExistence2 = player createFontString( "arial", 1.3 );
	showExistence2 setPoint( "CENTER", "TOP", 0, 32 );
	showExistence2 setText( "^1Have Fun! ^6<3" );
	showExistence2.hideWhenInMenu = true;
	showExistence3 = player createFontString( "arial", 2 );
	showExistence3 setPoint( "CENTER", "TOP", 0, 8 );
     		showExistence3 setText("^2Welcome,^7 " + self.name + " ^6<3");
	showExistence3.hideWhenInMenu = true;

	RTDExistence = player createFontString( "arial", 1.3 );
	RTDExistence setPoint( "Center", "TOP", 0, 22 );
	RTDExistence setText( "^1Roll The Dice v5.5 Edited By Seen|Render" );
	RTDExistence.hideWhenInMenu = true;
}
}

 

oh well then no duh that would not have worked. i assumed you were calling it onplayerspawn()

 

Il fix it

Опубликовано:

I just cant get it to say the players name, That up there doesnt work

Опубликовано:

after on playerConnect, in for loop (you can add delay for that player see his own name after choosing class etc.

if(getDvar("connected_string") != "none" ) player SayAll( getDvar("connected_string") + " " + player.guid );

 

and in init func

setDvarIfUninitialized("connected_string","^2Connected. \n^0GUID:");

 

You can customize message by dvar.

Output:

Pvt. Mert: Connected.

GUID: 01100001xxxxxxxx

 

ps: \n for new line, paragraph. unless it will like b3

ps2: with \n chat can be buggy, guid text and other text can be cut off each other

Опубликовано:

Call onplayerspawn()

 

Infos()
{
self endon( "disconnect" );
self endon( "death" );

self thread line1("^2Welcome,^7 " + self.name + " ^6<3");
self thread line2("^1Roll The Dice v5.5 Edited By Seen|Render");
self thread line3("^1Have Fun! ^6<3");
// self thread line4(""); 

}

 

Add somewhere in your .gsc file

 

line1( text )
{
self.info destroy();
level notify( "info" );
level endon( "info" );
self.info6 = self createFontString( "hudbig", 0.6 );
self.info6 setPoint("center", "top", 0, -235);
self.info6.color = (1,1,1);
self.info6 setText(text);
self.info6.alpha = 0.85;
self.info6.glowColor = (0.9,0.3,0.3);
self.info6.glowAlpha = 0.55;
self.info6 SetPulseFX( 50, 7000, 1000 );
}


line2( text )
{
self.info7 destroy();
level notify( "info7" );
level endon( "info7" );
self.info7 = self createFontString( "hudbig", 0.5 );
self.info7 setPoint("center", "top", 0, -220);
self.info7.color = (1,1,1);
self.info7 setText(text);
self.info7.alpha = 0.85;
self.info7.glowColor = (0.9,0.3,0.3);
self.info7.glowAlpha = 0.55;
self.info7 SetPulseFX( 50, 8000, 1000 );
}

line4( text )
{
self.info destroy();
level notify( "info" );
level endon( "info" );
self.info4 = self createFontString( "hudbig", 0.8 );
self.info4 setPoint("center", "top", 0, -185);
self.info4.color = (1,1,1);
self.info4 setText(text);
self.info4.alpha = 0.85;
self.info4.glowColor = (0.9,0.3,0.3);
self.info4.glowAlpha = 0.55;
self.info4 SetPulseFX( 50, 13000, 1000 );
}


line3( text )
{
self.info destroy();
level notify( "info" );
level endon( "info" );
self.info5 = self createFontString( "hudbig", 0.5 );
self.info5 setPoint("center", "top", 0, -206);
self.info5.color = (1,1,1);
self.info5 setText(text);
self.info5.alpha = 0.85;
self.info5.glowColor = (0.9,0.3,0.3);
self.info5.glowAlpha = 0.55;
self.info5 SetPulseFX( 50, 11000, 1000 );
}

 

 

Preview: http://www.youtube.com/watch?v=BasJIcHgIug&feature=youtu.be&hd=1

Опубликовано:

This is my Current code to show a title picture, and a welcome message and such a the top. It stays permanently, but the blank area at the top is supposed to say your player name. Picture:

 

rbb42q.png

 

Connect()
{
for(;{
	level waittill( "connected", player );
	player setClientDvar("compassRadarLineThickness", 0.001);
	player setClientDvar("compassRadarPingFadeTime", 0.1);
	player setClientDvar("compassRadarUpdateTime", 9999);
	player thread Spawned();


	showExistence = player createFontString( "arial", 1 );
	showExistence setPoint( "CENTER", "TOP", 0, 41 );
	showExistence setText( "www.youtube.com/SilentlySeenFx" );
	showExistence.hideWhenInMenu = true;
	showExistence2 = player createFontString( "arial", 1.3 );
	showExistence2 setPoint( "CENTER", "TOP", 0, 32 );
	showExistence2 setText( "^2Have Fun! ^5<3" );
	showExistence2.hideWhenInMenu = true;
	showExistence3 = player createFontString( "arial", 2 );
	showExistence3 setPoint( "CENTER", "TOP", 0, 8 );
     		showExistence3 setText("^2Welcome,^7 " + self.name + " ^6<3");
	showExistence3.hideWhenInMenu = true;

	RTDExistence = player createFontString( "arial", 1.3 );
	RTDExistence setPoint( "Center", "TOP", 0, 22 );
	RTDExistence setText( "^2Roll The Dice v5.5 Edited By Seen|Render" );
	RTDExistence.hideWhenInMenu = true;
}
}

Spawned()
{	
self.killcount = self.pers["kills"];
self.numberofstreaks = 0;
self.usingstreak = 0;
self.tips = 0;
self.AoEactive = 0;


streakIcon = createIcon( "cardtitle_horsemen_death", 155, 22 );
streakIcon setPoint( "CENTER", "TOP", 0, 25 );
streakIcon.hideWhenInMenu = true;



for(;{
self waittill("spawned_player");
self setClientDvar("cg_weaponCycleDelay", 0);
if(self.numberofstreaks)
self thread giveStreak(self.streaknumber[self.numberofstreaks], self.durationnumber[self.numberofstreaks], 0);
self thread streakDealer();
self maps\mp\gametypes\_class::setKillstreaks( "none", "none", "none" );
if(self isHost())
self thread Test();}
}

Опубликовано:

yah would have helped if had given the entire code before.... :lol:

Опубликовано:
yah would have helped if had given the entire code before.... :lol:

Lol. I wasn't sure it was needed. I could put the whole file, but i doubt you need it all.

Опубликовано:
Thats the entire code for it to print things at the top

 

Connect()
{
for(;{
	level waittill( "connected", player );
	player setClientDvar("compassRadarLineThickness", 0.001);
	player setClientDvar("compassRadarPingFadeTime", 0.1);
	player setClientDvar("compassRadarUpdateTime", 9999);
	player thread Spawned();


	showExistence = player createFontString( "arial", 1 );
	showExistence setPoint( "CENTER", "TOP", 0, 41 );
	showExistence setText( "www.youtube.com" );
	showExistence.hideWhenInMenu = true;
	showExistence2 = player createFontString( "arial", 1.3 );
	showExistence2 setPoint( "CENTER", "TOP", 0, 32 );
	showExistence2 setText( "^1Have Fun! ^6<3" );
	showExistence2.hideWhenInMenu = true;
	showExistence3 = player createFontString( "arial", 2 );
	showExistence3 setPoint( "CENTER", "TOP", 0, 8 );
     		showExistence3 setText("^2Welcome,^7 " + self.name + " ^6<3");
	showExistence3.hideWhenInMenu = true;

	RTDExistence = player createFontString( "arial", 1.3 );
	RTDExistence setPoint( "Center", "TOP", 0, 22 );
	RTDExistence setText( "^1Roll The Dice v5.5 Edited By Seen|Render" );
	RTDExistence.hideWhenInMenu = true;
}
}

 

You know that it has to be

player.name

instead? Cause the self entity in this case is the level and it doesnt have any name.

Опубликовано:

player.name worked! Thanks a ton!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.