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
Page
Previous Page
subscribe
Author Topic: why doesn't this work?
cybershot
General Member
Since: Dec 29, 2005
Posts: 944
Last: Mar 4, 2018
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Monday, Nov. 19, 2007 01:05 am
ok, success. but it's alittle wierd. Here is the final code that i ended up with

Code:

main()
{
trigger = getent("test", "targetname");
trigger waittill("trigger", user);

{
user iprintlnbold("this map was made by ^1Cyber^4Shot");
wait 5;
user iprintlnbold("This map was made for ASP");
wait 5;
user iprintlnbold("Sniper server 70.85.233.146");
wait 5;
user iprintlnbold("success");
}
}


i took out the loop that was in there because i figured i didn't need it, but also the trigger was made using a trigger multiple but the code only executes one time. Do you know why that is?
Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Monday, Nov. 19, 2007 04:14 am
Ok this is a simple fix! just call the thread again at the bottom like so
Code:
main()
{
thread say();
}

say()
{
trigger = getent("test", "targetname");
trigger waittill("trigger", user);

{
user iprintlnbold("this map was made by ^1Cyber^4Shot");
wait 5;
user iprintlnbold("This map was made for ASP");
wait 5;
user iprintlnbold("Sniper server 70.85.233.146");
wait 5;
user iprintlnbold("success");
wait 5;
thread say();
return;
}
}


I added in a new thread called say... then once the code was finished executing, it goes back up and waits till the trigger is triggered again to say everything again.
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
cybershot
General Member
Since: Dec 29, 2005
Posts: 944
Last: Mar 4, 2018
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Monday, Nov. 19, 2007 04:15 am
i will try it right now
Share |
cybershot
General Member
Since: Dec 29, 2005
Posts: 944
Last: Mar 4, 2018
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Monday, Nov. 19, 2007 04:23 am
that worked. i see, it just creates a simple loop...what is the return; suppose to . i took it out and the program still works. So is it really needed?
Share |
Restricted Access Topic is Locked
Page
Previous 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

»