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

Members Online

»
0 Active | 102 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 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: Disable USE key?
Hajas
General Member
Since: Feb 25, 2008
Posts: 37
Last: Oct 2, 2018
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Apr. 29, 2008 10:06 pm
Hello,

I'm already getting mad trying to look where is the code to this feature... [banghead]

I want to disable the use key at certain point in the middle of the match, but I simply can't find where this is triggered...

I already searched for usebuttonpressed and all that I found was simply ignored... :(

in _gameobjects I can disable the use in the bombs, ok, but I can't disable the pickup weapons in the ground, I already commented every single function at _weapons and I still can get weapons on the floor.

I can avoid the weapons be dropped easily, but isn't what I want to do...

the first thing that I did about this issue was went at weapons file...

Code:

onPlayerSpawned()
{
	self endon("disconnect");

	for(;;)
	{
		self waittill("spawned_player");

		self.concussionEndTime = 0;
		self.hasDoneCombat = false;
		//self thread watchWeaponUsage();
		//self thread watchGrenadeUsage();
		//self thread watchWeaponChange();
		
		self.droppedDeathWeapon = undefined;
		self.tookWeaponFrom = [];
		
		//self thread updateStowedWeapon();
	}
}


I already commented ALL of them, and STILL can pickup weapons on the floor... [mad]

there's also a function called watchPickup() which I also removed, and STILL can pickup the weapons... :(

there's nothing also in _globallogic what I see, so I think there's something above all that which is controlling the use key... any ideas?

thanks a lot!
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 Scripting
Posted: Tuesday, Apr. 29, 2008 10:17 pm
I think the stuff you're looking for is built in. WatchPickup() just waits until a player has picked up a new weapon, instead of controlling it.
Share |
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1437
Last: Jul 3, 2017
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Tuesday, Apr. 29, 2008 10:23 pm
maybe delete all dropped weapons? it will be a VERY repetitive script though...

Code:
<br />
deleteweaps()<br />
{<br />
ak47s = getentarray("weapon_ak47_mp","classname");<br />
for(i=0;i<ak47s.size;i++)<br />
ak47s[i] delete();<br />
<br />
// and so-on for all the weaps.....<br />
}<br />


edited on Apr. 29, 2008 06:26 pm by .KiLL3R.

edited on Apr. 29, 2008 06:27 pm by .KiLL3R.
Share |
Hajas
General Member
Since: Feb 25, 2008
Posts: 37
Last: Oct 2, 2018
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Apr. 29, 2008 10:38 pm
yes KiLL3R, this is my second option... there's a thread to make them disappear:

Code:

deletePickupAfterAWhile()
{
	self endon("death");
	
	wait 60;

	if ( !isDefined( self ) )
		return;

	self delete();
}


so I'll remake this to make recursive and test my far also, then exec the self delection to each map on that point.

this is my second chance, but I'm little afraid to do that and make the server laggy or something, since will be one of that running to each map on the floor...

maybe with many player could be a hell of slow or maybe even crash the server... I dunno...

that's why I thought about the use key...

I'll try also to UNBIND the key, then re-BIND again in the end of the round, but I don't know if I'll have the right to do that in the client...

well, any other ideas about the use key?

thanks a lot! :D
Share |
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1437
Last: Jul 3, 2017
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Tuesday, Apr. 29, 2008 10:42 pm
it wont lag your server, theres also a dvar for the max number of dropped weaps at one time too

g_maxdroppedweapons

though the max is 2, default 16
Share |
Hajas
General Member
Since: Feb 25, 2008
Posts: 37
Last: Oct 2, 2018
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Apr. 29, 2008 11:33 pm
great! nice found! but sadly is another stuff built on... :(

well, I'll move foward to remove all the weapons from the floor...

thanks for the help! :P
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 Scripting
Posted: Wednesday, Apr. 30, 2008 11:17 am
Unbinding wouldn't work, people could change/rebind some in the course of the game.
Share |
Hajas
General Member
Since: Feb 25, 2008
Posts: 37
Last: Oct 2, 2018
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Thursday, May. 1, 2008 08:16 pm
if you change the action, they can't rebind them... but I don't know if will be possible to do it with what we have in mod tools...

well, I removed the weapons and is working great right now! [rocking]

thanks anyway! [thumbs_up]
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Forum Moderator
Category: CoD4 Scripting
Posted: Thursday, May. 1, 2008 08:24 pm
They could [tongue]

\bind *key* *action*

edited on May. 1, 2008 04:24 pm by NovemberDobby
Share |
Hajas
General Member
Since: Feb 25, 2008
Posts: 37
Last: Oct 2, 2018
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Friday, May. 2, 2008 04:08 am
NovemberDobby writes...
Quote:
They could [tongue]

\bind *key* *action*



I mean, if for exemple the action is +use ok? if I change that to +use435 you can bind how many keys you want to +use that will never work, since +use isn't any valid action anymore...

since you will never know the new action command name that I changed, you will never be able to rebind that action again until I revert the action...

that's why I said change the ACTION, not the key. [biggrin]

but I believe this is not possible in COD4 because we don't have this part of the code... (I think, because I even checked)

I already done that in a anti-cheat to Quake II, and works really great... but with Q2, I had the full source in C to work, not just a part like in COD4 SDK... [wink]
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

»