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

Members Online

»
0 Active | 68 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
Next Page
subscribe
Author Topic: Force MOD download
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Sep. 7, 2012 12:01 pm
yo,

so i took a script from worm's powerserver mod which force players to download mod, basically, it works that players who don't have mod downloaded, cant see an invisible image and that way they see blue/grey squares.

heres code

Code:
Init()
{	
	game["force_download"] = "gfx/custom/empty.tga";
	precacheShader(game["force_download"]);
	
	level thread onPlayerConnect();
}

onPlayerConnect()
{
	for(;;)
	{
		level waittill("connecting", player);

		if (!isdefined(player.forcedownload))
		{
			player.forcedownload = newClientHudElem(player);
			player.forcedownload.horzAlign = "left";
			player.forcedownload.vertAlign = "top";
			player.forcedownload.x = 0;
			player.forcedownload.y = 0;
			player.forcedownload setShader(game["force_download"], 640, 480);
		}
	}
}


does anybody know how to make people see that invisible picture when they connect? cause now, they have to choose a team to see it.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Friday, Sep. 7, 2012 12:46 pm
The player sees it once they've connected to the server - it says so in the code:

Code:
level waittill( "connecting", player );


The key word is "connecting", as in once they've connected.
Share |
z0d
General Member
Since: Apr 29, 2012
Posts: 33
Last: May 8, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Sep. 7, 2012 02:38 pm
-nvm-
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Sep. 7, 2012 05:37 pm
no, the keyword here is menus.

Once connected, menus are opened which prevent the player from viewing any huds. Close menus on players that you detect to NOT have downloaded the mod. Use some elaborate menuresponse thingy to accomplish this.
Share |
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Sep. 7, 2012 06:00 pm
but problem is, when i make a menu, all other menus which opens, close. basically i cannot open chat neither teamchat neither i can change weapon or smth.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Friday, Sep. 7, 2012 06:09 pm
IzNoGoD writes...
Quote:
no, the keyword here is menus.

Once connected, menus are opened which prevent the player from viewing any huds. Close menus on players that you detect to NOT have downloaded the mod. Use some elaborate menuresponse thingy to accomplish this.


No, the KEY word in the code posted in the OP is "connecting". There is no mention of "menu". If you want to start your own thread about menus, then you are free to do so. Until then, don't tell me what English words are in code posted when I can quite easily read it for myself.

As for your "suggestion", if a mod server is running a custom gametype, then when a player without downloads on connects to the server, no menus open since he doesn't have the necessary gametype file to open a menu on connect. So, Worm created a server-side way to run a hud element on a player which told the player something was wrong - it was a huge great checker board image. They usually disconnected and tried again, upon which time they were successful because there is another part of the mod which forced the dvar cl_allowdownload on.
Share |
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Sep. 7, 2012 08:08 pm
does any of you know how to make a menu which opens on a start which uses that invisible picture? or how to make picture shows when player connects, not when choses a team?
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Friday, Sep. 7, 2012 08:20 pm
maxxis95 writes...
Quote:
does any of you know how to make a menu which opens on a start which uses that invisible picture? or how to make picture shows when player connects, not when choses a team?


I don't want to appear rude, but is English not your first language? Because I just said, that code puts the image on a player when they connect. That is the only way to do it, so if it isn't working, then you're screwed.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Sep. 8, 2012 06:58 am
Tally writes...
Quote:
IzNoGoD writes...
Quote:
no, the keyword here is menus.

Once connected, menus are opened which prevent the player from viewing any huds. Close menus on players that you detect to NOT have downloaded the mod. Use some elaborate menuresponse thingy to accomplish this.


No, the KEY word in the code posted in the OP is "connecting". There is no mention of "menu". If you want to start your own thread about menus, then you are free to do so. Until then, don't tell me what English words are in code posted when I can quite easily read it for myself.

As for your "suggestion", if a mod server is running a custom gametype, then when a player without downloads on connects to the server, no menus open since he doesn't have the necessary gametype file to open a menu on connect. So, Worm created a server-side way to run a hud element on a player which told the player something was wrong - it was a huge great checker board image. They usually disconnected and tried again, upon which time they were successful because there is another part of the mod which forced the dvar cl_allowdownload on.


Disagree. When you dont have the correct .menu file for that, you connect WITHOUT the "spectator" hud elem. This means that the game tries to open a menu, fails, but doesnt show any huds.

Try a closemenu() and closeingamemenu() onconnect and you should be ok-ish.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, Sep. 8, 2012 08:05 am
IzNoGoD writes...
Quote:
Tally writes...
Quote:
IzNoGoD writes...
Quote:
no, the keyword here is menus.

Once connected, menus are opened which prevent the player from viewing any huds. Close menus on players that you detect to NOT have downloaded the mod. Use some elaborate menuresponse thingy to accomplish this.


No, the KEY word in the code posted in the OP is "connecting". There is no mention of "menu". If you want to start your own thread about menus, then you are free to do so. Until then, don't tell me what English words are in code posted when I can quite easily read it for myself.

As for your "suggestion", if a mod server is running a custom gametype, then when a player without downloads on connects to the server, no menus open since he doesn't have the necessary gametype file to open a menu on connect. So, Worm created a server-side way to run a hud element on a player which told the player something was wrong - it was a huge great checker board image. They usually disconnected and tried again, upon which time they were successful because there is another part of the mod which forced the dvar cl_allowdownload on.


Disagree. When you dont have the correct .menu file for that, you connect WITHOUT the "spectator" hud elem. This means that the game tries to open a menu, fails, but doesnt show any huds.

Try a closemenu() and closeingamemenu() onconnect and you should be ok-ish.


I just tested this, using Worm's PowerServer mod. On a 1.0 server running a custom gametype (in PowerServer, it is Hold the Flag), the missing hud element doesn't work on connect, because the game goes straight to opening the team menu. However, on a 1.2/1.3 server running a custom gametype, the missing hud element works, because the first menu to open is the serverinfo menu. If the client doesn't have the serverinfo menu because he hasn't downloaded the mod files (and therefore doesn't have the Hold the Flag serverinfo.menu), the client connects looking out as a spectator does, and the missing image (chequer board) fills the screen.

On a stock gametype running version 1.2 or 1.3, as the client has the stock gametype (I tested with both CTF and TDM) serverinfo.meu, the menu opens and ruins the effect of having the missing image hud element run on them.

So, you are both right, and wrong. Depends what version of the game the OP is running.

Worm developed the missing hud image method for his PowerServer mod circa version 1.3. In older versions of PowerServer, Worm was unconcerned about client downloads because everything was server-side. But when Worm started adding custom weapons (he has a custom teller mine in PowerServer), he realised he needed some method of telling a client they didn't have the mod files and so couldn't take advantage of any custom weapons.

Quote:
Try a closemenu() and closeingamemenu() onconnect and you should be ok-ish.


The whole point about Worm's method was to not inconvenience client's who had downloads switched on. If you simply run a closemenus command on all clients irrespective of whether or not they have downloads switch on, you are going to screw with them unnecessarily, and closing all menus on connect will leave clients who have downloads on scratching their heads because they would be left looking out into space with no menus to choose.

The missing shader method is meant to be surreptitious - working in the background with no bother to those with downloads on. You need a method like this, which discriminates between those who have downloads on, and those who don't.
Share |
Restricted Access Topic is Locked
Page
Next 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

»