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

Members Online

»
0 Active | 90 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 subscribe
Author Topic: Timer Function [HELP]
L3uX
General Member
Since: Mar 14, 2012
Posts: 20
Last: May 6, 2013
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Saturday, Mar. 17, 2012 04:31 pm
Hey guys,

i will script a timer if the timer is done the round will be restart.
i have a timer but how can i make the function?
my timer go to 0:0 and nothing... how can i make a timer ?
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Mar. 17, 2012 05:32 pm
Store everything you want stored in the player.pers[] array, so you can rewrite this to the player once restarted.

Then, call map_restart(true); from script. This will do a round restart like the SD gametype.
Share |
L3uX
General Member
Since: Mar 14, 2012
Posts: 20
Last: May 6, 2013
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Saturday, Mar. 17, 2012 05:59 pm
i have a zombie mod and i will count 4 minutes in a round and after the 4 minutes need to be called the function checkRestart for my zombie mod.
i will make a countdown like UP Zombies.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Mar. 17, 2012 06:04 pm
L3uX writes...
Quote:
i have a zombie mod and i will count 4 minutes in a round and after the 4 minutes need to be called the function checkRestart for my zombie mod.
i will make a countdown like UP Zombies.


How is this an addition to your first post? I gave you all the info you needed in my post...
Share |
L3uX
General Member
Since: Mar 14, 2012
Posts: 20
Last: May 6, 2013
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Saturday, Mar. 17, 2012 06:27 pm
I dont know what you mean...
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: Saturday, Mar. 17, 2012 10:57 pm
iznogod is trying to tell you to save all the players info like what weapon your player is using before restart kinda like SD so when you do restart by using map_restart(true); your players weapons and everything will be saved. take a look in sd.gsc if you're confused.
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Sunday, Mar. 18, 2012 10:17 am
What is similar

Code:
time = 60*4;
for(i=time;i>0;i--)
{
player = getEntArray( "player", "classname" );
for( i = 0; i < player.size; i++ )
{
players = player[i];
if(!isdefined(players.time))
{
players.time = newClientHudElem(players);
players.time.alignx = "center";
players.time.x = 330;
players.time.y = 100; 
players.time.fontscale = 1.2;
players.time.label = &"Time for restart";
players.time setValue(i);
}
else
players.time setValue(i);
}
wait 1;
}
player = getEntArray( "player", "classname" );
for( i = 0; i < player.size; i++ )
{
players = player[i];
if(isdefined(players.time))
{
players.time destroy();
}
}
thread maps\mp\gametypes\_zom::checkRestart();
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Sunday, Mar. 18, 2012 11:51 am
if(isdefined(players.time))->if(!isdefined(players.time)) (line 8 or smthing)

Also, this script does just do the count, not the actual restart. To quote the topicstarter:
Quote:
i will script a timer if the timer is done the round will be restart.
i have a timer but how can i make the function?

Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Mar. 18, 2012 12:22 pm
this should do the job:
Code:
timer()
{
	time = 240; // 4 min
	
	level.roundtimer = newHudElem();
	level.roundtimer setTimer( time );

	wait( time );

	map_restart( true );
}
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

»