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

Members Online

»
0 Active | 49 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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
Page
Previous Page
subscribe
Author Topic: bold text in middle of screen
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Sep. 23, 2009 04:47 pm
sherlokpwnz writes...
Quote:
not really. you could open it just to see how the function of posting a message on the screen and try to impliment it into gsc scripting. it's only stealing the authors work if it's the same coding but guessing as gsc is different than c+ or apache coding then it wouldn't be stealing work.


Ok, a couple of mistakes in your post:

1. The very act of reverse engineering an .EXE is a crime, as it infringes the copyright/EULA of the program, and is prohibited under International law. So, it doesnt matter what you intend to use it for, it doesnt stop it being a crime.

2. I dont believe the guy wants to script anything. He wants to print a message to the center of the screen with rcon. 2 very different things. And anyway, rcon4cod2 doesnt have a function to print a message to the center of the screen - it prints them to the left-hand side of the screen, where all console messages appear. So, what would be the point of looking at the source code of that program? It wont give you what the OP wants anyway.

3 GSC is not a language, its a file type. The language that the COD engine uses doesnt really have a formal name, but IW and most modders/coders refer to it as cod script.
Share |
|S!T|
General Member
Since: Nov 8, 2007
Posts: 93
Last: Dec 9, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Wednesday, Sep. 23, 2009 04:52 pm
:D
easy guys :D
forget the thing with the exe...
i'm not afraid to implement a script...i did that with a function to switch players in spectator or in the other team.
But i havent done it by myself - a guy gave me the script and explained it to me!
Then i built it into my mod and it works ^^
now i want to add the thing with the message in the center as a cvar or however it could work :)
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Sep. 23, 2009 05:07 pm
|S!T| writes...
Quote:
:D
easy guys :D
forget the thing with the exe...
i'm not afraid to implement a script...i did that with a function to switch players in spectator or in the other team.
But i havent done it by myself - a guy gave me the script and explained it to me!
Then i built it into my mod and it works ^^
now i want to add the thing with the message in the center as a cvar or however it could work :)


Well, if its for a mod, then no problem:

Code:
init()
{
	setdvar("sayallcenter", "");
	
	while( !level.gameEnded )
	{
		v_SayAllCenter = getdvar("sayallcenter");
		
		if( v_SayAllCenter != "" ) thread sayAll( v_SayAllCenter );
		
		wait 0.05;
	}
}

sayAll( Message )
{

	iprintlnbold( Message );
	setdvar( "sayallcenter", "" );

}


The code isnt mine - its been used in a lot of mods for COD, from AWE to Xtreme+ mods for COD2.

Add the code to your mod, and make sure the init() method has a thread to it.

To use it after it has been added, just drop down console and type:

/sayallcenter whatyouwantosay <---- this is the message
Share |
|S!T|
General Member
Since: Nov 8, 2007
Posts: 93
Last: Dec 9, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Wednesday, Sep. 23, 2009 08:21 pm
Thx a lot demonSeed :)
thats what i searched!

first of all, do i need to write /rcon sayallcenter ? i hope so ^^

But now i got a question...is it possible to add something like this:

/sayallcenter Warning [ClientID] - you're breaking the rules!

Is this possible?And if it is, how?! :)

there should be something in the code like, for example

Code:

			players = getentarray("player", "classname");
			for(i = 0; i < players.size; i++)


Or not? :D

thx 4 all ;)

edited on Sep. 23, 2009 04:21 pm by |S!T|
Share |
|S!T|
General Member
Since: Nov 8, 2007
Posts: 93
Last: Dec 9, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Sep. 25, 2009 01:01 pm
ehm - up?! :)
Share |
clanhelio
General Member
Since: Aug 30, 2008
Posts: 223
Last: Mar 24, 2011
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Sep. 27, 2009 04:34 am
I made a thread about this and came to my own conclusion. I don't think I posted it, though.

/rcon whisper # blahblah

Don't worry about those "name" variables, this started out as a name changing command.
Code:
whisper()
{
	setcvar("whisper","");
	setcvar("whisperinteger","");
	while(1)
	{
		namevar = getcvar("whisper");
		if(namevar != "")
		{
			if((isdefined(namevar[0])) && (isanumber(namevar[0])))
			{
				if((isdefined(namevar[1])) && (isanumber(namevar[1]))) //slot # is 2 digits
				{
					persnum = namevar[0] + namevar[1];
					setcvar("whisperinteger",persnum);
					newname = "^0";
					
					for(i = 3; i < namevar.size; i++)
					{	
						if(i == 3)
						{
							newname = namevar[i];
						}
						else
						{
							newname = newname + namevar[i];
						}
					}
					
					
				}
				else //slot # is 1 digit
				{
					persnum = namevar[0];
					setcvar("whisperinteger",persnum);
					newname = "^0";
					
					for(i = 2; i < namevar.size; i++)
					{	
						if(i == 2)
						{
							newname = namevar[i];
						}
						else
						{
							newname = newname + namevar[i];
						}
					}
					
				}
				playernum = getcvarint("whisperinteger");
				players = getentarray("player", "classname");
				for(i = 0 ;  i  <  players.size ;  i++)
				{
					thisPlayerNum = players[i] getEntityNumber();
					if(thisPlayerNum == playernum) // this is the one we're looking for
					{
						players[i] iprintlnbold(newname);
					
					}
				}
			}
			setcvar("whisper", "");
		}
		wait(0.5);
	}
}

isanumber(str)
{
	if( (str == "0") || (str == "1") || (str == "2") || (str == "3") || (str == "4") || (str == "5")
		|| (str == "6") || (str == "7") || (str == "8") || (str == "9") )
	{
		return true;
	}
	else
	{
		return false;
	}
}
Share |
|S!T|
General Member
Since: Nov 8, 2007
Posts: 93
Last: Dec 9, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Sunday, Sep. 27, 2009 10:36 am
thx clanhelio -
but this is like a whispering message - so just the guy with the called ID can see it right?! I want that everybody can see the Message...is this possible too?
Share |
clanhelio
General Member
Since: Aug 30, 2008
Posts: 223
Last: Mar 24, 2011
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Monday, Sep. 28, 2009 04:03 am
Use demonseed's script.
Share |
Restricted Access Topic is Locked
Page
Previous Page
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

»