Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Welcom Message
wastanley
General Member
Since: Mar 3, 2012
Posts: 13
Last: Nov 21, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Wednesday, Jul. 18, 2012 04:59 pm
Hi modders,

I just want to make a custom HC mod with some WWII weapons and with other little modifications. I already wrote everything, but the last component caught me. That is the welcome message. I have the script of the message, but i don't know where and how I had to call the script. Can somebody write me an opener command?
Thank you your helping!

Regards, Stanley.


P.S.:

Here is my welcome message script. The file's name is _stanley_koszonto.gsc

main()
{
delay = 30;
for(;;) {

level waittill("connected", player);
wait (7.0);
player thread welc_issue(.5, "Üdv a szerveren" + player.name + ".");
wait (5.0);
player thread welc_issue(.5, "Jó szórakozást!");
}
}

welc_issue(delay, welc)
{
self endon("intermission");
self endon("disconnect");
self endon("killthreads");
self endon("game_ended");

wait(delay);

notifyData = spawnStruct();
notifyData.notifyText = welc;
notifyData.glowColor = (0.3, 0.6, 0.3);
notifyData.duration = level.welcomeduration;

notifyData.sort = 5;
notifyData.hideWhenInMenu = true;
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Wednesday, Jul. 18, 2012 08:49 pm
Don't run messages on a player while they are connecting - they wont see them. Always run them on a player once they've spawned.

Code:
main()
{
	
	level.welcomeduration = 4.0;
	
	level thread onPlayerConnect();

}

onPlayerConnect()
{
	for(;;) 
	{

		level waittill( "connected", player );
		
		player.messageDone = undefined;
		
		player thread onPlayerSpawned();
	}
}

onPlayerSpawned()
{
	for( ;; )
	{
		self waittill( "spawned_player" );
		
		self thread player thread welc_issue( "Üdv a szerveren" + player.name + ".", "Jó szórakozást!" );
	}
}

welc_issue( welc1, welc2 )
{
	if( isDefined( self.messageDone ) )
		return;
		
	self.messageDone = true;
	
	self endon( "intermission" );
	self endon( "disconnect" );
	self endon( "killthreads" );
	self endon( "game_ended" );

	notifyData = spawnStruct();
	notifyData.notifyText = welc;
	notifyData.glowColor = (0.3, 0.6, 0.3);
	notifyData.duration = level.welcomeduration;

	notifyData.sort = 5;
	notifyData.hideWhenInMenu = true;
	self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
	
	wait( 2 );
	
	notifyData = spawnStruct();
	notifyData.notifyText = welc2;
	notifyData.glowColor = (0.3, 0.6, 0.3);
	notifyData.duration = level.welcomeduration;

	notifyData.sort = 5;
	notifyData.hideWhenInMenu = true;
	self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
} 
Share |
wastanley
General Member
Since: Mar 3, 2012
Posts: 13
Last: Nov 21, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Wednesday, Jul. 18, 2012 09:21 pm
And inwhich file I had to call these script?
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Wednesday, Jul. 18, 2012 09:32 pm
wastanley writes...
Quote:
And inwhich file I had to call these script?


In maps\mp\gametypes\_globallogic::Callback_StartGametype();

Put it where most of the other GSC files are threaded from. You will see a whole bunch of them there. Just thread your custom GSC (_stanley_koszonto.gsc) from there.

Example:

Code:
	thread maps\mp\gametypes\_persistence::init();
	thread maps\mp\gametypes\_menus::init();
	thread maps\mp\gametypes\_hud::init();
	thread maps\mp\gametypes\_serversettings::init();
	thread maps\mp\gametypes\_clientids::init();
	thread maps\mp\gametypes\_teams::init();
	thread maps\mp\gametypes\_weapons::init();
	thread maps\mp\gametypes\_scoreboard::init();
	thread maps\mp\gametypes\_killcam::init();
	thread maps\mp\gametypes\_shellshock::init();
	thread maps\mp\gametypes\_deathicons::init();
	thread maps\mp\gametypes\_damagefeedback::init();
	thread maps\mp\gametypes\_healthoverlay::init();
	thread maps\mp\gametypes\_spectating::init();
	thread maps\mp\gametypes\_objpoints::init();
	thread maps\mp\gametypes\_gameobjects::init();
	thread maps\mp\gametypes\_spawnlogic::init();
	thread maps\mp\gametypes\_oldschool::init();
	thread maps\mp\gametypes\_battlechatter_mp::init();
	
	//=================================================
	thread maps\mp\gametypes\_stanley_koszonto::main();
	//==================================================


Share |
wastanley
General Member
Since: Mar 3, 2012
Posts: 13
Last: Nov 21, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Thursday, Jul. 19, 2012 06:53 am
Ahh, I understood. Thank you for your heliping! I owe you one! [wave]

Hi, Stanley.
Share |
wastanley
General Member
Since: Mar 3, 2012
Posts: 13
Last: Nov 21, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Thursday, Jul. 19, 2012 07:11 am
I tried the mod in my server, but it isn't want to start, because the server isn't like this line: self thread player thread welc_issue( "Üdv a szerveren" + player.name + ".", "Jó szórakozást!" );
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Thursday, Jul. 19, 2012 08:05 am
wastanley writes...
Quote:
I tried the mod in my server, but it isn't want to start, because the server isn't like this line: self thread player thread welc_issue( "Üdv a szerveren" + player.name + ".", "Jó szórakozást!" );


Edit the line then:

Code:
self thread welc_issue( "Üdv a szerveren" + player.name + ".", "Jó szórakozást!" );
Share |
wastanley
General Member
Since: Mar 3, 2012
Posts: 13
Last: Nov 21, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Thursday, Jul. 19, 2012 10:00 am
It isn't works yet. These line is the gulity again.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Thursday, Jul. 19, 2012 10:09 am
wastanley writes...
Quote:
It isn't works yet. These line is the gulity again.


Code:
main()
{
	
	level.welcomeduration = 4.0;
	
	level thread onPlayerConnect();

}

onPlayerConnect()
{
	for(;;) 
	{

		level waittill( "connected", player );
		
		player.messageDone = undefined;
		
		player thread onPlayerSpawned();
	}
}

onPlayerSpawned()
{
	for( ;; )
	{
		self waittill( "spawned_player" );
		
		self thread thread welc_issue( "Üdv a szerveren" + self.name + ".", "Jó szórakozást!" );
	}
}

welc_issue( welc1, welc2 )
{
	if( isDefined( self.messageDone ) )
		return;
		
	self.messageDone = true;
	
	self endon( "intermission" );
	self endon( "disconnect" );
	self endon( "killthreads" );
	self endon( "game_ended" );

	notifyData = spawnStruct();
	notifyData.notifyText = welc;
	notifyData.glowColor = (0.3, 0.6, 0.3);
	notifyData.duration = level.welcomeduration;

	notifyData.sort = 5;
	notifyData.hideWhenInMenu = true;
	self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
	
	wait( 2 );
	
	notifyData = spawnStruct();
	notifyData.notifyText = welc2;
	notifyData.glowColor = (0.3, 0.6, 0.3);
	notifyData.duration = level.welcomeduration;

	notifyData.sort = 5;
	notifyData.hideWhenInMenu = true;
	self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
} 
Share |
wastanley
General Member
Since: Mar 3, 2012
Posts: 13
Last: Nov 21, 2012
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Thursday, Jul. 19, 2012 10:50 am
It works with some little modifications.

self thread thread welc_issue( "Üdv a szerveren" + self.name + ".", "Jó szórakozást!" );

There was an extra thread, i deleted.

And here was unknown variable. I wrote the welc to welc1, and it works!

notifyData.notifyText = welc;

Thank you for your help again!

Stanley

edited on Jul. 19, 2012 06:22 am by wastanley
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»