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

Members Online

»
0 Active | 90 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 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
Author Topic: Cod4: Scripting Reference
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 MP Mapping
Posted: Saturday, Dec. 1, 2007 08:54 pm
lol oops, how did that happen
Share |
Vistrum
General Member
Since: Jan 2, 2007
Posts: 146
Last: Mar 12, 2010
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Saturday, Dec. 1, 2007 11:49 pm
Awesome, I like your ideas. I havent messed with the scripts that much yet, just made a few basic ones like:

Warping a player to another player,
Disableing and enabling weapons for 1 player,
Posting messages on the screen.

A little more than a day's worth of work, because I wasnt very familiar with the code... had to learn what everything did, etc.

Any requests and I'll do what I can xD
Share |
Vistrum
General Member
Since: Jan 2, 2007
Posts: 146
Last: Mar 12, 2010
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Sunday, Dec. 2, 2007 12:14 am
where can I find the effects used in CoD4? I'm kinda working on a form of a custom perk xD
Share |
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1437
Last: Jul 3, 2017
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Sunday, Dec. 2, 2007 12:28 am
the only editable things atm on cod4 are some sounds, images/skins and ripped scripts
your going to have to wait for the mod tools for anything else
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 MP Mapping
Posted: Sunday, Dec. 2, 2007 12:32 am
maybe if we can open the ff files we can change it! hey has anyone got an ff file opener to open ff files! oh i have big plans, oh yes, like an crysis mod!

watch this space! [machine_gun][machine_gun][machine_gun]
Share |
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1437
Last: Jul 3, 2017
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Sunday, Dec. 2, 2007 12:36 am
matrix mod ftw!
Share |
Vistrum
General Member
Since: Jan 2, 2007
Posts: 146
Last: Mar 12, 2010
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Sunday, Dec. 2, 2007 04:52 am
I'm not looking to make it a true perk.. More of an action using buttonpressed();.

While waiting for a response to this, I put this together:

Code:

main()
{
thread RedefinePlayers(); // NovemberDobby's RedefinePlayers.
thread playerstats();
}


RedefinePlayers()
{
while (1)
{		
level.pp = getentarray("player","classname");
wait 0.1;
}}

playerstats()
{
	setdvar("scr_playerhealth", "-1");
	setdvar("scr_playerhealthto", "-1");
	setdvar("scr_playerscore", "-1");
	setdvar("scr_playerdeaths", "-1");
	while(1)
	{
	if(isdefined(level.pp))
	{
		scvar = "scr_playerhealth";
		hpAmount = getdvarint("scr_playerhealthto"); // scr_playerhealthto == user defined player health amount to change the current amount to.
		player = getdvarint("scr_playerhealth"); // scr_playerhealth == user defined player client number.  		
		scAmount = getdvarint("scr_playerscore");
		dsAmount = getdvarint("scr_playerdeaths");
		

		if(gcvsingle(scvar) == "true")///////////////////////////////////////INDIVIDUALS////////////////////////////////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		playerNum = level.pp[i] getEntityNumber();
		
		if(player == playerNum)
		{			//LINE 300

		if(hpAmount != "-1")///////////HEALTH/////////////
		{
		level.pp[i].health = hpAmount;
		setdvar("scr_playerhealthto", "-1");
		}

		if(scAmount != "-1")/////////////SCORE////////////
		{
		level.pp[i].kills = scAmount;
		setdvar("scr_playerscore", "-1");
		}
		
		if(dsAmount != "-1")//////////////DEATHS//////////////
		{
		level.pp[i].deaths = dsAmount;
		setdvar("scr_playerdeaths", "-1");
		}
		setdvar("scr_playerhealth", "-1");
		}
		}
		}

		if(getdvar("scr_playerhealth") == "-5") ////////////////////////////EVERYONE////////////////////////////
		{

		if(hpAmount != "-1") /////////////////////HEALTH/////////////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		level.pp[i].health = hpAmount;
		setdvar("scr_playerhealthto", "-1");
		}
		}
		
		if(scAmount != "-1") ////////////////////SCORE///////////////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		level.pp[i].kills = scAmount;
		setdvar("scr_playerscore", "-1");
		}
		}
		
		if(dsAmount != "-1") /////////////////DEATHS////////////////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		level.pp[i].deaths = dsAmount;
		setdvar("scr_playerdeaths", "-1");			///LINE 350
		}
		}
		
		setdvar("scr_playerhealth", "-1"); 
		}

		if(getdvar("scr_playerhealth") == "-2") ///////////////////////////ALLIES////////////////////////
		{
		
		if(hpAmount != "-1") //////////////////HEALTH//////////////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		if (isdefined(level.pp[i].pers["team"]) && level.pp[i].pers["team"] == "allies")
		{
		level.pp[i].health = hpAmount;
		setdvar("scr_playerhealthto", "-1");
		}
		}
		}

		if(scAmount != "-1") ////////////////////////SCORE////////////////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		if (isdefined(level.pp[i].pers["team"]) && level.pp[i].pers["team"] == "allies")
		{
		level.pp[i].kills = scAmount;
		setdvar("scr_playerscore", "-1");
		}
		}
		}

		if(dsAmount != "-1") ///////////////////////DEATHS////////////////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		if (isdefined(level.pp[i].pers["team"]) && level.pp[i].pers["team"] == "allies")
		{
		level.pp[i].deaths = dsAmount;
		setdvar("scr_playerdeaths", "-1");
		}
		}
		}

		setdvar("scr_playerhealth", "-1");
		}

		if(getdvar("scr_playerhealth") == "-3") ///////////////////////////////////AXIS///////////////////////////
		{			//LINE 400
		
		if(hpAmount != "-1") /////////////HEALTH///////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		if (isdefined(level.pp[i].pers["team"]) && level.pp[i].pers["team"] == "axis")
		{
		level.pp[i].health = hpAmount;
		setdvar("scr_playerhealthto", "-1");
		}
		}
		}
	
		if(scAmount != "-1") //////////////////SCORE////////////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		if (isdefined(level.pp[i].pers["team"]) && level.pp[i].pers["team"] == "axis")
		{
		level.pp[i].kills = scAmount;
		setdvar("scr_playerscore", "-1");
		}
		}
		}

		if(dsAmount != "-1")//////////////////////DEATHS///////////////////
		{
		for(i = 0; i < level.pp.size; i++)
		{
		if (isdefined(level.pp[i].pers["team"]) && level.pp[i].pers["team"] == "axis")
		{
		level.pp[i].deaths = dsAmount;
		setdvar("scr_playerdeaths", "-1");
		}
		}
		}
		
		setdvar("scr_playerhealth", "-1");
		}
	}}}
		

		



gcvsingle(scvar) //Taken from NovemberDobby's.
{
if (getdvar("scvar") != "-1" && getdvar(scvar) != "-2" && getdvar(scvar) != "-3" && getdvar(scvar) != "-5") return "true";
else return "false";
}


It all compiles successfully, though, the game seems to go into a continuous loop or something...

It will load up in my LAN server and get to "Awaiting Challenge..." and it will just lock up there.. Any ideas?
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 MP Mapping
Posted: Sunday, Dec. 2, 2007 09:29 am
make sure there's a wait 0.05; after the new while(1) statement(s)

and do sv_pure 0 in the shortcut

and sometimes, using \developer 1 will alert you to errors that arent related to your script, so if you're using that then you probably don't need to
Share |
zeroy
General Member
Since: Nov 26, 2007
Posts: 1060
Last: Mar 12, 2014
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Sunday, Dec. 2, 2007 01:55 pm
Vistrum writes...
Quote:

It all compiles successfully, though, the game seems to go into a continuous loop or something...

It will load up in my LAN server and get to "Awaiting Challenge..." and it will just lock up there.. Any ideas?


He Vistrum, what does this script do?
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 MP Mapping
Posted: Sunday, Dec. 2, 2007 04:26 pm
looks like it's for playin with player's health, score, and deaths. i've got that and more atm; need some new ideas [lol]
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

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

»