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

Members Online

»
0 Active | 8 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: welcome script
|S!T|
General Member
Since: Nov 8, 2007
Posts: 93
Last: Dec 9, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Tuesday, Feb. 8, 2011 12:35 am
hi everybody,
i was trying to make a welcome script for my server.

Found this script 30 pages ago but i did something wrong.

Error (bad syntax) comes up if i start a new server in SD gametype.

Okay, here is the script.

I created a new gsc (_welcome.gsc)

Code:
Init()

welcomeMessage()
	{
	self endon("disconnect");
	
	self waittill("spawned_player");

	self iprintlnbold("Hi," + self.name + "! ^7Welcome To tehserverr :P");
	self iprintlnbold("Follow All Rules!");
	self iprintlnbold("Proud sponsors with: www.website.org");
	self iprintlnbold("Modded By The modsonline team");
	}


and i also threaded the gsc in my sd.gsc

Code:
	thread maps\mp\gametypes\_welcome::init();



I read about paste the code right into the sd.gsc but i tried and i also did something wrong -.-

here is the callback_playerconnect-part from my sd.gsc

Code:
Callback_PlayerConnect()
{
	thread dummy();

	self.statusicon = "";
	self waittill("begin");
	self.statusicon = "";

	level notify("connected", self);

	if(!isdefined(self.pers["team"]) && !level.splitscreen)
		iprintln(&"MP_CONNECTED", self.name);

	lpselfnum = self getEntityNumber();
	lpselfguid = self getGuid();
	logPrint("J;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");


	// * GAME MOD *  
	if(game["gdm_enabled"] == 1) self maps\mp\gametypes\_gdm_mod_player::PlayerConnect();




	if(game["state"] == "intermission")
	{
		spawnIntermission();
		return;
	}

	level endon("intermission");

	if(level.splitscreen)
	{
		if(isdefined(self.pers["weapon"]))
			scriptMainMenu = game["menu_ingame_onteam"];
		else
			scriptMainMenu = game["menu_ingame_spectator"];
	}
	else
		scriptMainMenu = game["menu_ingame"];

	if(isdefined(self.pers["team"]) && self.pers["team"] != "spectator")
	{
		self setClientCvar("ui_allow_weaponchange", "1");

		if(isdefined(self.pers["weapon"]))
			spawnPlayer();
		else
		{
			self.sessionteam = "spectator";

			spawnSpectator();

			scriptMainMenu = self maps\mp\gametypes\_menus::gdm_menuSelection();

		}
	}
	else
	{
		self setClientCvar("ui_allow_weaponchange", "0");

		if(!level.xenon)
		{
			if(!isdefined(self.pers["skipserverinfo"])) self openMenu(game["menu_serverinfo"]);
			else self openMenu(game["menu_team"]);
		}
		else
			self openMenu(game["menu_team"]);


		self.pers["team"] = "spectator";
		self.sessionteam = "spectator";

		spawnSpectator();
	}

	self setClientCvar("g_scriptMainMenu", scriptMainMenu);
}



Where is the error?And what means bad syntax?did i spelled something wrong? ^^

please help me out ;)

edited on Feb. 7, 2011 07:34 pm by |S!T|

edited on Feb. 7, 2011 07:34 pm by |S!T|
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Tuesday, Feb. 8, 2011 04:06 pm
your first code has Init() then no opening or closing bracket. plus you have a another func inside Init() wich i dont know what you are threading Init() or welcomeMessage(). so either put the opening and closing bracket for Init and take out the welcomeMessage() and its opening and closing brackets. or if Init is not what your threading then delete that part and just keep welcomeMessage().
Share |
|S!T|
General Member
Since: Nov 8, 2007
Posts: 93
Last: Dec 9, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Tuesday, Feb. 8, 2011 04:38 pm
edited the _welcome.gsc


Code:
welcomeMessage()
	{
	self endon("disconnect");
	
	self waittill("spawned_player");

	self iprintlnbold("Hi," + self.name + "! ^7Welcome To tehserverr :P");
	self iprintlnbold("Follow All Rules!");
	self iprintlnbold("Proud sponsors with: www.website.org");
	self iprintlnbold("Modded By The modsonline team");
	}


then i edited my sd.gsc

Code:
	thread maps\mp\gametypes\_welcome::welcomeMessage();


Server runs now - but nothing shows up after i spawned...



edited on Feb. 8, 2011 11:55 am by |S!T|

here's the thread where i took the script

http://modsonline.com/Forums-top-115232-0.html%23695538
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Wednesday, Feb. 9, 2011 03:24 pm
Dude
You call a (level) thread and call to self in there...

change it to a self thread
Code:

thread
->
self thread
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»