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

Members Online

»
0 Active | 42 Guests
Online:

LATEST FORUM THREADS

»
Call of DutyŽ: WWII
CoD WW2 General
SOF2 Prefabs map
SoFII Mapping
coduo mapping tools
CoDUO 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 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: welcome picture issues
BUSH1DO
General Member
Since: Apr 2, 2014
Posts: 40
Last: Sep 9, 2016
[view latest posts]
Level 2
Category: CoD4 MP Mapping
Posted: Friday, Jul. 17, 2015 10:59 pm
hi all, need help to make code working correct.

Code:
#include maps\mp\_utility;

#include maps\mp\gametypes\_hud_util;

#include common_scripts\utility;

main()
{


	maps\mp\_load::main();

        preCacheShader("intropic")
        thread onPlayerConnect();



} 
onPlayerConnect()
{
	level endon("game_ended");
	
	for(;;)
	{
		level waittill("connected", player);
		
                player thread onPlayerSpawned();
		
	}
}
onPlayerSpawned()   
{
	self endon("disconnect"); 	
	for(;;)
	{
		self waittill( "spawned_player" );
                self thread the_intropic();
                
	}

}
the_intropic()
{
                if(isDefined(self.the_intropic))
		self.the_intropic destroy();
                wait 7;

                self.the_intropic = newClientHudElem(self);
			self.the_intropic.alignX = "center";
			self.the_intropic.alignY = "top";
			self.the_intropic.horzAlign = "fullscreen";
			self.the_intropic.vertAlign = "fullscreen";
			self.the_intropic.x = 310;
			self.the_intropic.y = -450;
			self.the_intropic.alpha = 0;
			self.the_intropic.sort = 1;
			self.the_intropic.hideWhenInMenu = false;
			self.the_intropic setShader("intropic", 400, 450);
			self.the_intropic.alpha = 1;

                self.the_intropic moveOverTime(5);
                self.the_intropic.y = 20;
                wait (10);
                self.the_intropic moveOverTime(2);
                self.the_intropic.x = 1000;
                wait (2);
                self.the_intropic destroy();

                wait 0.05;
}

what i want is to picture to be shown only one time at first spawn
from now it appears every time after respawn
and if i make onplayerconnect it appears even when in menu
pls any fix in code [banghead]
Share |
MPKiller545
General Member
Since: Jun 28, 2010
Posts: 42
Last: Sep 27, 2017
[view latest posts]
Level 2
Category: CoD4 MP Mapping
Posted: Saturday, Jul. 18, 2015 03:31 am
Maybe try moving this:

Code:


onPlayerSpawned()   
{
	self endon("disconnect"); 	
	for(;;)
	{
		self waittill( "spawned_player" );
                self thread the_intropic();
                
	}

}


into this:

Code:

onPlayerSpawned()   
{
	self waittill( "spawned_player" );
        self thread the_intropic();
                
	self endon("disconnect"); 	
	for(;;)
	{
            self waittill( "spawned_player" );

	}

}


or create a variable that will indicate which time player has spawned:
Code:


onPlayerSpawned()   
{
        self.spawn_times  = 0;
	self endon("disconnect"); 	
	for(;;)
	{
		self waittill( "spawned_player" );
                self.spawn_times++;

                if(self.spawn_times == 1)
                    self thread the_intropic();
                
	}

}


But I'm not sure if it's good idea.


edited on Jul. 18, 2015 03:32 am by MPKiller545
Share |
BUSH1DO
General Member
Since: Apr 2, 2014
Posts: 40
Last: Sep 9, 2016
[view latest posts]
Level 2
Category: CoD4 MP Mapping
Posted: Sunday, Jul. 19, 2015 05:01 am
thanks a lot first code work fine [jumping]
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

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

»