| Author |
Topic: Welcom Message |
| wastanley |
General Member Since: Mar 3, 2012 Posts: 13 Last: Nov 21, 2012 [view latest posts] |
|
|
|
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 );
}
|
 |
|
|
| Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
|
|
| wastanley |
General Member Since: Mar 3, 2012 Posts: 13 Last: Nov 21, 2012 [view latest posts] |
|
|
|
|
| Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
|
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();
//==================================================
|
 |
|
|
| wastanley |
General Member Since: Mar 3, 2012 Posts: 13 Last: Nov 21, 2012 [view latest posts] |
|
|
|
|
| wastanley |
General Member Since: Mar 3, 2012 Posts: 13 Last: Nov 21, 2012 [view latest posts] |
|
|
|
|
| Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
|
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!" );
|
 |
|
|
| wastanley |
General Member Since: Mar 3, 2012 Posts: 13 Last: Nov 21, 2012 [view latest posts] |
|
|
|
|
| Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
|
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 );
}
|
 |
|
|
| wastanley |
General Member Since: Mar 3, 2012 Posts: 13 Last: Nov 21, 2012 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|