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

Members Online

»
0 Active | 9 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: 2 players have access to a function at the same time, how?
newbie11
General Member
Since: Jan 23, 2007
Posts: 59
Last: Aug 3, 2009
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Sunday, Aug. 2, 2009 07:21 pm
hi guys
i havent asked for your help for a long time but i got a question now
i have a function in my script and i want all players to have access to it at the same time
for example someone hits a trigger and a long-time action starts, while the action is still in progress if someone else hits the trigger the function should play for him too
can someone explain the basics of this?
i tried with
Code:
	for(;;)
	{
	players = getentarray("player", "classname");
		for(i = 0; i < players.size; i++) 
		{
			players[i] thread FUNCTION();
			//etc....

but this way the function keeps constantly being triggered
[confused]
Share |
clanhelio
General Member
Since: Aug 30, 2008
Posts: 223
Last: Mar 24, 2011
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, Aug. 2, 2009 07:42 pm
um just make the function a thread, and call that when the trigger is pressed.

Code:
trigger waittill("trigger",user);
user thread function();


function()
{
//yadda yadda
Share |
newbie11
General Member
Since: Jan 23, 2007
Posts: 59
Last: Aug 3, 2009
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Monday, Aug. 3, 2009 09:52 am
omg i tried such complicated scripts ...
and it was the most simple thing possible :D
ty :)
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

»