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

Members Online

»
0 Active | 47 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
Next Page
subscribe
Author Topic: player_substainammo 1
[aL]Damo
General Member
Since: Mar 24, 2010
Posts: 187
Last: Nov 3, 2011
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Sunday, Aug. 22, 2010 07:27 pm
Hi there everybody

Im wanting to know if it is posible to force the dvar player_substainammo 1 on a cheat protected server and if it can be done i have read about it before but i cant seem to find the article anymore.

edited on Aug. 22, 2010 03:52 pm by [LoG]Damo

Sorry just notised i had posted it in the wrong place would a mod mind moving it to scripting please :)
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Sunday, Aug. 22, 2010 08:50 pm
Yes it's possible.

Code:
unlimitedAmmo()
{
	if(!getDvarInt("player_sustainammo"))
	{
		setDvar("player_sustainammo", 1);
		iprintln("^1Unlimited Ammo Enabled");
	}
else
	{
		setDvar("player_sustainammo", 0);
		iprintln("^1Unlimited Ammo Disabled");
	}
}
Share |
[aL]Damo
General Member
Since: Mar 24, 2010
Posts: 187
Last: Nov 3, 2011
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Sunday, Aug. 22, 2010 09:51 pm
_INSANE_ writes...
Quote:
Yes it's possible.

Code:
unlimitedAmmo()
{
	if(!getDvarInt("player_sustainammo"))
	{
		setDvar("player_sustainammo", 1);
		iprintln("^1Unlimited Ammo Enabled");
	}
else
	{
		setDvar("player_sustainammo", 0);
		iprintln("^1Unlimited Ammo Disabled");
	}
}


Ty So this will allow me to force ammo on a cheat protected server
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Sunday, Aug. 22, 2010 10:47 pm
Yep..that allows you to switch it on or off whenever you want. Just run the thread whenever you feel like switching it.
Share |
[aL]Damo
General Member
Since: Mar 24, 2010
Posts: 187
Last: Nov 3, 2011
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Monday, Aug. 23, 2010 05:21 pm
_INSANE_ writes...
Quote:
Yep..that allows you to switch it on or off whenever you want. Just run the thread whenever you feel like switching it.


OK imma gonna be a pain again i have attempted to reverse it to make it off instead of on so its capable of turning it off,

Here is the script i tried

Quote:

ammo_stockpile2()
{
trigger = getent("ammo_crate2", "targetname");
{
trigger waittill ("trigger",user);
trigger thread unlimitedAmmo2();
}
}
unlimitedAmmo2()
{

if(!getDvarInt("player_sustainammo"))
{
setDvar("player_sustainammo", 0);
iprintln("^2Unlimited ammo activated");
}
else
{
setDvar("player_sustainammo", 1);
iprintln("^2Unlimited ammo de-activated");
}
}


I don't know if this is rite though as it dident work

Ty
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Monday, Aug. 23, 2010 06:09 pm
This should work:

Code:

ammo_stockpile()
{
	level.isAmmoUnlimited = false;

	trigger = getEnt( "ammo_crate2", "targetname" );
	
	while(1)
	{
		trigger waittill( "trigger", user );
		user thread unlimitedAmmo();
	}
}

unlimitedAmmo()
{
	if( level.isAmmoUnlimited )
	{
		level.isAmmoUnlimited = false;
		setDvar( "player_sustainammo", 0 );
		iPrintLn( "^2Unlimited ammo activated" );
	}	
	else if( !level.isAmmoUnlimited );
	{
		level.isAmmoUnlimited = true;
		setDvar( "player_sustainammo", 1 );
		iPrintLn( "^2Unlimited ammo activated" );
	}
}
Share |
[aL]Damo
General Member
Since: Mar 24, 2010
Posts: 187
Last: Nov 3, 2011
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Monday, Aug. 23, 2010 07:16 pm
Xylozi writes...
Quote:
This should work:

Code:

ammo_stockpile()
{
	level.isAmmoUnlimited = false;

	trigger = getEnt( "ammo_crate2", "targetname" );
	
	while(1)
	{
		trigger waittill( "trigger", user );
		user thread unlimitedAmmo();
	}
}

unlimitedAmmo()
{
	if( level.isAmmoUnlimited )
	{
		level.isAmmoUnlimited = false;
		setDvar( "player_sustainammo", 0 );
		iPrintLn( "^2Unlimited ammo activated" );
	}	
	else if( !level.isAmmoUnlimited );
	{
		level.isAmmoUnlimited = true;
		setDvar( "player_sustainammo", 1 );
		iPrintLn( "^2Unlimited ammo activated" );
	}
}



Bad syntax if( level.isAmmoUnlimited )
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Monday, Aug. 23, 2010 07:30 pm
What exactly are you trying to do... set unlimited ammo on one player?
Share |
[aL]Damo
General Member
Since: Mar 24, 2010
Posts: 187
Last: Nov 3, 2011
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Monday, Aug. 23, 2010 07:40 pm
_INSANE_ writes...
Quote:
What exactly are you trying to do... set unlimited ammo on one player?


well im wanting to set it so when a player uses one trigger it turns it on, and another that turns it off
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Monday, Aug. 23, 2010 07:43 pm
For the player alone or everyone?
Share |
Restricted Access Topic is Locked
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

»