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

Members Online

»
0 Active | 139 Guests
Online:

LATEST FORUM THREADS

»
Call of DutyŽ: WWII
CoD WW2 General
eXtreme+ v2.9
CoDBO Map + Mod Releases

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: Mod
codnerd
General Member
Since: Jul 15, 2008
Posts: 16
Last: May 6, 2009
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Tuesday, Jul. 15, 2008 01:45 am
I need to make a mod with a custom dvar such as g_gravity 1.

Exactly, how do I do this? I know very, very little about modding.
Share |
_INSANE_
General Member
Since: Nov 6, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Thursday, Jan. 22, 2009 08:56 am
I suppose I'll answer this.... * 6 months later *[casanova]

1. You don't need to make a mod for this.
2. It's not a custom dvar, it already exists.
3. Not only do you know very little about modding, but it may be the same for cod4...
MEANING...[tongue]

Login to the server if you are the admin.
Do this by typing into the console:
/rcon login password (replace 'password' with your pass)
Then type /rcon set g_gravity 1

Ta-da
[thumbs_up]
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Thursday, Jan. 22, 2009 10:37 am
If g_gravity was an example of a dvar and you want to add a new one, then more info of how its being used would be useful. Typically you add something like
Code:
if(getDvar("my_newDvar") == "") setdvar("my_newDvar",1);

to your code in order to initialise it. You then use the dvar like:
Code:
if(getDvar("my_newDvar") == 1)
{
   // Do Stuff
}
Share |
securiity
General Member
Since: Jan 11, 2009
Posts: 63
Last: May 31, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Saturday, Jan. 31, 2009 09:22 pm
shouldnt it be if(getDvar("my_newDvar") == "") setdvar("my_newDvar";1); instead of the , in front of the 1 at the end?
Share |
_INSANE_
General Member
Since: Nov 6, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Sunday, Feb. 1, 2009 12:44 am
Quote:
shouldnt it be if(getDvar("my_newDvar") == "") setdvar("my_newDvar";1); instead of the , in front of the 1 at the end?


No, A semicolon (;) , Indicates the end of a code.



edited on Feb. 1, 2009 02:45 am by INSANE{H|S}

edited on Feb. 1, 2009 02:47 am by INSANE{H|S}
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Sunday, Feb. 1, 2009 03:22 am
Correct Insane - comas are used to separate arguments in functions, of which setdvar is one.

http://www.infinityward.com/Script/dvars/setdvar.htm
Share |
_INSANE_
General Member
Since: Nov 6, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Sunday, Feb. 1, 2009 03:23 am
or you use a semicolon in a " for " loop


Code:
for( i=0; i < 20 ; i++ )
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

»