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

Members Online

»
0 Active | 93 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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Script runs at everybody who activate trigger
Slipknot14
General Member
Since: Feb 23, 2005
Posts: 109
Last: Sep 4, 2012
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Sunday, Nov. 23, 2008 04:53 pm
So I want to make a script that runs, after somebody activate the trigger. But if I use simply waittill, then it runs only at that one player, who is the user. I made a key system, where you need to get activate 2 triggers, and than if you activate the last trigger you are be teleported. BUT if somebody once make my global varibales true(get the 2 triggers(keys) active), than other ppls don't need it, and they just activate the last one, and they are telelported.
So here is my script

Quote:
main()
{
level.seal_earth = false;
level.seal_water = false;

thread getstarted();
thread sealearth();
thread sealwater();

}

GetStarted()
{
theseal = getentarray ("theseal","targetname");
if(isdefined(theseal))
{
for(i=0;i theseal[ i ] thread Thinking();
}
}

Thinking()
{
while(1)
{
self waittill ("trigger", user);
if (level.seal_earth && level.seal_water){
user setOrigin( (2936,-4208,464) );
}
else if(!level.seal_water){
self iprintlnbold("Go and find the seals!");
}
else if(!level.seal_earth){
self iprintlnbold("Go and find the seals!");
}
wait 0.01;
}
}

SealEarth()
{
trig = getent("earth_seal","targetname");
while(1)
{
trig waittill ("trigger", user);
user setOrigin( (3899,-4028,-3137) );
iprintlnbold("You found it, now you have the ^2Earth Seal^7!");
level.seal_earth = true;
wait 0.01;
}
}

SealWater()
{
trig = getent("water_seal","targetname");
while(1)
{
trig waittill ("trigger", user);
user setOrigin( (3899,-4028,-3137) );
iprintlnbold("You found it, now you have the ^4Water Seal^7!");
level.seal_water = true;
wait 0.01;
}
}


My question is: is it possible to make personal script, only for the user of a trigger, or a personal varibale, that changes only at the user, or somehow change a variable from outside of a thread(not global varibale)

thanks,creep

edited on Nov. 23, 2008 11:54 am by Slipknot14

edited on Nov. 23, 2008 11:56 am by Slipknot14
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»