MODSonline
  Welcome Guest to MODSonline Home | Forums | Register | Login
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoDWW Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
[ToC]Black... [Forum]
ROTCGuy [Forum]

2 Members and 13 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Friday, Nov. 21st
CoD:WW Video Tutorial is up!
Friday, Nov. 21st
MODSonair Episode 154
Thursday, Nov. 20th
Call Of Duty World At War - Mod Tools
Wednesday, Nov. 19th
Half-Life 1 $0.98
Sunday, Nov. 16th
MODSonair 154 Live
Latest Poll
Would you pay for mod tools?
I would pay a one time fee for mod tools for my favorite title 8.46%
I would pay a monthly/yearly subsrciption fee for mod tools for my favorite title 0.5%
I already paid for the game - Tools should come bundled because I am just fixing what the developers broke 68.16%
100% definitely NOT! 18.91%
I haven't seen a game yet that wasn't 100% perfect when the developers released it 2.49%
Games are the devil! 1.49%
Read More...
16 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
script compile error
CoD 4 Scripting.. Posts: (13) Views: (79) by ThisGuy
SKYBOX ; tut
CoD:WW Level Des.. Posts: (1) Views: (16) by [ToC]Blackjak
Running a mod with downloads from redirect
CoD:WW Scripting.. Posts: (2) Views: (12) by Tally
[WIP] SP_Paradise
CoD 4 Single Pla.. Posts: (17) Views: (532) by starkk
Art of War Central Half-Life 2 Mods for Dummies
CoDWW Download
Forums
MODSonline.com 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, rEdrUmMDK, Foxhound, Wyatt_Earp, Rasta, StrYdeR, The_Caretaker, Cypher2004, batistablr, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: A Multiplayer damage system for door blockers
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Wednesday, Dec. 27, 2006 07:51 am
Howdy folks!

I thought this would make a nice addition to your maps that have doors or areas where players can cause trouble by blocking them.

It's hot off my keyboard tonight! [thumbs_up]
All the info you need is at the top of the script.

Enjoy! and Merry Christmas to you all..
Grassy

PS, sorry it's not in a Code Box, the forum was adding heaps
of rubbish to the code. So it's lost the nice indents I had in there.. [banghead]


Quote:

//------------------------------------------------------------------------------
//
// Damage control for Cod/Uo/Cod2 Multi Player
// by <|WHC|>Grassy
// Version 2
// Updated December 27, 2006
//
//
// Usefull for controlling players who like to block
// doorways or other scripted events.
//
// Place trigger_multiples in these areas, as many as you need
// Give them all a KEY: targetname with a VALUE: dmg
//
// To set a delay use a KEY: script_delay and VALUE: XX
// where XX is any whole number you want as your delay before the player
// begins to take damage.
// Default delay if not set on the trigger is 5 seconds.
//
// This new version can now handle different Damage levels for each trigger.
// To set a damage level set a KEY: script_dmg and VALUE: XX
// where XX is any whole number for the level of damage inflicted
// on the player while in the trigger after the delay has been reached.
// Default damage level if not set is 10.
//
// This has been tested in Cod1 and UO but not Cod2
// If you find this script fails in Cod2 then it's more than
// likely the sound command line is the problem, to fix this
// change the sound alias to some other generic "tick" type of
// sound that Cod2 loads by default.
//
// I don't have Cod2 anyore so if someone wants to make this
// compatable then feel free to go ahead with it.
//
//
// To load, usual procedure. Place this script in maps/mp/ and call it damage_control.gsc
// Then add this line to your maps .gsc file.
// maps\mp\damage_control::main();
//
// I hope you find this little utility usefull, if you have problems you
// can get me on Xfire with username of grassy or drop into
// my clan website www.whcclan.com and leave me a msg there.
//
// Regards Grassy
//
//----------------------------------------------------------------------------------


main()
{
//collect delayed hurt triggers
ent = getentarray("dmg","targetname");

if(isdefined(ent))
{
for(d = 0 ; d < ent.size ; d ++)
{

//If a delay is defined use that - otherwise set it to 5
if(isdefined(ent[d].script_delay))
{
delay = ent[d].script_delay;
}
else
{
delay = 5;
}

//If damage level is defined use that - otherwise set it to 10
if(isdefined(ent[d].script_dmg))
{
dmg = ent[d].script_dmg;
}
else
{
dmg = 10;
}

ent[d] thread damage_handler(delay,dmg);
}
}
}

//-----------------------end of main-----------------------


damage_handler(delay,dmg)
{
for(;;)
{
counter = 0;
self waittill("trigger",other);

other iprintlnbold("^3*Warning* you will take damage in ^7" + delay + " seconds" + " ^3if you stay here.");

// loop until done killing player or dump out if:
// 1: Not touching the trigger anymore
// 2: not alive
// 3: You are a spectator

while(other istouching(self)
&& isAlive(other)
&& other.sessionstate != "spectator")
{
wait 1;
counter++;
other playsound("minefield_click"); // <---- this may need to be edited for Cod2!

if(counter >= delay)
{
//dmg = 10;
other.health -= dmg;

if(other.health == 50)
other iprintlnbold("^3Move or you will die!");

other viewkick(96, other.origin);
other shellshock("default_mp", 1);

if(other.health <= 0)
{
other suicide();
iprintln ("^1SERVER MESSAGE: ^7" + other.name + " ^1was punished for blocking.");
other.sessionstate = "dead";
}
}
}
wait(1);
}
}

Rasta
Preferred Member
Since: Apr 10, 2004
Posts: 4294
Last: Nov 21, 2008
[view latest posts]
Level 9
Forum Moderator
Category: CoD2 Scripting
Posted: Wednesday, Dec. 27, 2006 10:12 am
Nice work buddy. I have stickied it untill an admin can lay there mits on it :)
Go ahead... You Play I Mod : MODSonline.com
Support Modsonline by becoming a PREFERRED MEMBER today
Have you heard the MODSonair Podcast?: www.modsonair.com
We are game enthusiasts from the MODSonline.com community bringing you news, updates and opinions of the week's current events. Tune in every Friday for a new episode.
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Wednesday, Dec. 27, 2006 05:45 pm
Cheers Rasta old pal [thumbs_up]
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1130
Last: Nov 21, 2008
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Wednesday, Jul. 18, 2007 07:27 pm
nice work

i think it would be better for the gameplay if doors would push the player away instead of lowering health...
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting
All logos and trademarks and information in this site are property of MODSonline LLC © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
Intergi
Partners
Battle for Europe COD2
XoXide
Call of Duty Headquarters
CODAddicts - Call of Duty News & Downloads
Frag Universe
The Firing Box
modbase.be
Ask About
Advertising
Friends
ModTheater
SOF2 Files and Downloads
CoD 4 Base
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
MODSonair Episode 154
MODSonair Episode 153
MODSonair Episode 152
MODSonair Episode 151
Video server move
Next Show
The next MODSonair show will air LIVE on:
11/23/2008 12:00 EST

Time remaining:
Copyright © 2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted   Tresware