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

Members Online

»
0 Active | 70 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: World at War
Category: CoDWW Scripting
Scripting and coding with Call of Duty: World at War.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Disableweapons Command - Bugged , or mistake?
xholyx
General Member
Since: Oct 17, 2007
Posts: 116
Last: Sep 7, 2010
[view latest posts]
Level 4
Category: CoDWW Scripting
Posted: Friday, Aug. 21, 2009 12:48 pm
I used in a repair function script the function Disableweapons.
The function useually kept disabling the weapons, but now it seems to disable them for a second and then enable them again without using Enableweapons command

This is the script i have sofar, the script was first differently, but out of frustration it became like this.

*Note* The isValid command is a custom function i made to check if a player verify's all variables to use it ( Playing , not spectating etc. )

player.hasDis = player has not been disabled, i made this variable as i thought maybe when i did it once the disable function would act the same. But no..


m = machine entity
self = the trigger at the machine being repaired at the repairFunc
Code:

repairFunc(m)
{

while(1)
	{
	self waittill("trigger",player);
	if(isValid(player) && player useButtonPressed())
		{
		wait 1;
		m.repairstate++;
		player thread notTouched(self);
		if(!player.hasDis)
			{
			player thread DisableW(self);
			}
		
		if(m.repairstate >= level.repairhealth)
			{
			
			thread Transform(m);
			player notify("transformed");
			self.origin = self.origin - (0,0,100000);
			player.hasDis = false;
			player enableWeapons();
			}
			
		
		}
	if(isvalid(player) && !player useButtonPressed())
		{
		iPrintLn("Not repairing");
		}
	}

}

DisableW(t)
{
self endon("transformed");

while(self useButtonPressed())
	{
	wait 0.05;
	self disableWeapons();
	self.hasDis = true;
	}
}
			

notTouched(t)
{
wait 0.5;
if(!self isTouching(t))
	{
	self iPrintLn("Not touching");
	wait 0.5;
	if(!self isTouching(t))
		{
		self enableWeapons();
		self.hasDis = false;
		self iPrintLn("Not touching 2");
		}
	}

}


Example video.


Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty: World at War : CoDWW 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

»