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
gunny0311 [Downl]
4mori_rabbit [Forum]
justonemore [Forum]
uberrogue [Proje]

4 Members and 15 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Monday, Dec. 1st
A message from foyleman
Sunday, Nov. 30th
MODSonair 156 Live
Friday, Nov. 28th
MODSonair Episode 155
Wednesday, Nov. 26th
MODSonair Forum Buttons
Monday, Nov. 24th
Holiday Gift Guide 2008 - PC
Latest Poll
Single or Multiplayer maps for World at War?
Single-Player 30.12%
Multiplayer 61.45%
WHAT!? The tools are out? 8.43%
Read More...
10 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
A message from foyleman
In The News.. Posts: (5) Views: (47) by 4mori_rabbit
Clan vs All
CoD:WW Scripting.. Posts: (1) Views: (1) by uberrogue
Zombie Map Issues with Launcher also.
CoD:WW Level Des.. Posts: (9) Views: (143) by Spuddy
Hud
CoD General Gami.. Posts: (1) Views: (12) by Harbinger
Google 468 Banner 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 4
Category: CoD 4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, rEdrUmMDK, Foxhound, Rasta, StrYdeR, The_Caretaker, batistablr, playername, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Basic killingspree, firstblood... messages code?
Reavensito
General Member
Since: Jul 22, 2006
Posts: 74
Last: Nov 21, 2008
[view latest posts]
Level 3
Category: CoD 4 Scripting
Posted: Tuesday, Jul. 22, 2008 12:01 pm
Hey all. Well, I'm trying to make a code which shows the killingspree, firstblood... messages, but I don't get it work. I would like if you can help me with this, or post a basic code.

Also, I'm trying, since a month, make dvars to remove GL, martyrdom and last stand, and I don't know why the fu*k, it doesn't work. Can you help me with this, too?

Thanks.
The_Caretaker
Preferred Member
Since: Jun 8, 2004
Posts: 11559
Last: Oct 4, 2008
[view latest posts]
Level 10
Forum Moderator
Category: CoD 4 Scripting
Posted: Tuesday, Jul. 22, 2008 05:36 pm
I looked around the stock scripts a bit, and my guess is, the streaks are handled either in a script which is not in the /raw folder, or internally by the gameengine.

playerSpawned()
{
self endon("death")
self.killstreak = 0;
while(1)
{
if (self killed) self.killstreak++;
// something to monitor if self killed someone, possibly through the sellf.score value?

if (self.killstreak = 1) println ("first blood");
if (self.killstreak = 2) println ("second kill);
etc
}

}

Something like that might work. The trouble is registering the kill.

As for the dvars, what script are you using? Because 'it doesn't work' is not giving me any ideas what might be wrong.
Reavensito
General Member
Since: Jul 22, 2006
Posts: 74
Last: Nov 21, 2008
[view latest posts]
Level 3
Category: CoD 4 Scripting
Posted: Tuesday, Jul. 22, 2008 06:00 pm
Well, I mean that at the end, I get back to the start. All are 'mini-scripts' I try.


Quote:
level.allowedPerks[0][ 0] = 190; // 190 through 193 are attachments and "none"
level.allowedPerks[0][ 1] = 191;
level.allowedPerks[0][ 2] = 192;
/* Perk attachment disabled
level.allowedPerks[0][ 3] = 193;
*/



Quote:
primary_attachment_ref = level.tbl_WeaponAttachment[primary_attachment_flag]["reference"];
secondary_attachment_ref = level.tbl_WeaponAttachment[secondary_attachment_flag]["reference"];
if ( primary_attachment_ref == "grip" || primary_attachment_ref == "gl" || secondary_attachment_ref == "grip" || secondary_attachment_ref == "gl" )
{
if ( specialty1 != 190 && specialty1 != 191 && specialty1 != 192 && specialty1 != 193 )
{
println( "^1Warning: (" + self.name + ") grip or grenade launcher is used but perk 1 was index " + specialty1 + ". Setting perk 1 to none." );
specialty1 = 165; //193 = there's an attachment, so no perk
}
}



Quote:
level.allow_martyrdom_laststand = getdvarx( "rge_allow_martyrdom_laststand", "int", 0, 0, 1 );
if ( level.allow_martyrdom_laststand == 0 )
{
if ( specialty3 == 158 || specialty3 == 157 )
specialty3 = 154;
}


I had got another with level.allow_gl, but I removed it tired of tryings.

Thanks 4 your help

edited on Jul. 22, 2008 06:01 pm by Reavensito
Reavensito
General Member
Since: Jul 22, 2006
Posts: 74
Last: Nov 21, 2008
[view latest posts]
Level 3
Category: CoD 4 Scripting
Posted: Tuesday, Jul. 22, 2008 06:56 pm
Now I'm trying with the firstblood messages, and always there is the error -> uninitialised variable 'if(isplayer(attacker))'
Reavensito
General Member
Since: Jul 22, 2006
Posts: 74
Last: Nov 21, 2008
[view latest posts]
Level 3
Category: CoD 4 Scripting
Posted: Tuesday, Jul. 22, 2008 07:18 pm
I made this (even I tried with the waittill("killed_player");), but when I kill myself, nothing happens...


Code:


edited on Jul. 22, 2008 07:19 pm by Reavensito
OutPoursTheRED
General Member
Since: Jun 3, 2007
Posts: 77
Last: Nov 22, 2008
[view latest posts]
Level 3
Category: CoD 4 Scripting
Posted: Saturday, Jul. 26, 2008 10:57 am
Doing attacker = undefined; right before isPlayer(attacker) is obviously going to fail as the attacker is undefined right before it.

Add to callback_playerKilled in globallogic:


Code:


Then change your first blood thread to:


Code:


Also in the game startup you need to originally define level.firstblood = true;

That should work fine - untested though so you may need to tweak it a little more. Post again if you have major issues.
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 4 : CoD 4 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.
MODSonline Subscriptions
Partners
Battle for Europe COD2
modbase.be
The Firing Box
Call of Duty Headquarters
Frag Universe
CODAddicts - Call of Duty News & Downloads
XoXide
Ask About
Advertising
Friends
Canada Kicks Ass Clan
ModTheater
SOF2 Files and Downloads
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 155
MODSonair Episode 154
MODSonair Episode 153
MODSonair Episode 152
MODSonair Episode 151
Next Show
The next MODSonair show will air LIVE on:

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