MaZiCUT 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 536 
	Threads: 31 
	Joined: Jun 2012
	
 Reputation: 
17
		
	 | 
	
		
			
Crowbar unlocks a closet, doesen't work. 
			 
			
				So i'm trying to make a Crowbar to unlock a closet, i don't want any crowbar to show up or so, i just want the closet to unlock when i use the crowbar on it. But i get this goddamn fatal error even though i do every goddamn thing correctly    
.lang
 
This could come handy. 
Crowbar
 
.hps
 
void OnStart() 
{ 
	AddUseItemCallback("", "CrowbarForCabinet", "cabinet", "OpenCabinetDoor", true);	
 
}
 
void OpenCabinetDoor(string &in item, string &in door) 
{ 
SetSwingDoorLocked(cabinet, false, true); 
PlaySoundAtEntity("", "unlock_door", cabinet, 0, false); 
RemoveItem(CrowbarForCabinet); 
}
 
void CeilingDoorLocked(string &in entity) 
{ 
if(GetSwingDoorLocked("CeilingDoor") == true) 
{ 
SetMessage("Messages", "PopupCeilingDoor", 0); 
} 
}
  
i get no errors and the map works when the script is like this:
 
.hpl
 
void OnStart() 
{ 
	AddUseItemCallback("", "CrowbarForCabinet", "cabinet", "OpenCabinetDoor", true);	
 
}
 
void OpenCabinetDoor(string &in item, string &in door) 
{ 
SetSwingDoorLocked( door, false, true); 
PlaySoundAtEntity("", "unlock_door", cabinet, 0,  false); 
RemoveItem( item); 
}
 
void CeilingDoorLocked(string &in entity) 
{ 
if(GetSwingDoorLocked("CeilingDoor") == true) 
{ 
SetMessage("Messages", "PopupCeilingDoor", 0); 
} 
}
  
 
 
fatal error:
  
			 
			
			
 
Hi. 
			
				
(This post was last modified: 06-22-2012, 11:03 PM by MaZiCUT.)
 
				
			 
		 |  
	 
 | 
 
	| 06-18-2012, 11:38 AM  | 
	
		
	 | 
 
 
	
		
		Rownbear 
 
 
		
			Member 
			
			
			
 
			
	Posts: 157 
	Threads: 13 
	Joined: Apr 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Crowbar unlocks a closet, doesen't work. 
			 
			
				missing "" on these 
SetSwingDoorLocked(cabinet, false, true); 
PlaySoundAtEntity("", "unlock_door", cabinet, 0, false); 
RemoveItem(CrowbarForCabinet);
			 
			
			
 
			
				
(This post was last modified: 06-18-2012, 11:46 AM by Rownbear.)
 
				
			 
		 |  
	 
 | 
 
	| 06-18-2012, 11:44 AM  | 
	
		
	 | 
 
 
	
		
		MaZiCUT 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 536 
	Threads: 31 
	Joined: Jun 2012
	
 Reputation: 
17
		
	 | 
	
		
			
RE: Crowbar unlocks a closet, doesen't work. 
			 
			
				 (06-18-2012, 11:44 AM)Rownbear Wrote:  missing "" on these 
SetSwingDoorLocked(cabinet, false, true); 
PlaySoundAtEntity("", "unlock_door", cabinet, 0, false); 
RemoveItem(CrowbarForCabinet); Oh i just noticed, it's not only for the CrowbarForCabinet, i've missed at "cabinet" and "cabinet" 
 
damn you silly wiki tutorial   
 
 (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:  missing "" on these 
SetSwingDoorLocked(cabinet, false, true); 
PlaySoundAtEntity("", "unlock_door", cabinet, 0, false); 
RemoveItem(CrowbarForCabinet); Oh i just noticed, it's not only for the CrowbarForCabinet, i've missed at "cabinet" and "cabinet"  
 
 
damn you silly wiki tutorial    Well atleast the map loads, but the goddamn crowbar aint opening the closet   
			 
			
			
 
Hi. 
			
				
(This post was last modified: 06-18-2012, 11:51 AM by MaZiCUT.)
 
				
			 
		 |  
	 
 | 
 
	| 06-18-2012, 11:48 AM  | 
	
		
	 | 
 
 
	
		
		Rownbear 
 
 
		
			Member 
			
			
			
 
			
	Posts: 157 
	Threads: 13 
	Joined: Apr 2011
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Crowbar unlocks a closet, doesen't work. 
			 
			
				 (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:  missing "" on these 
SetSwingDoorLocked(cabinet, false, true); 
PlaySoundAtEntity("", "unlock_door", cabinet, 0, false); 
RemoveItem(CrowbarForCabinet); Oh i just noticed, it's not only for the CrowbarForCabinet, i've missed at "cabinet" and "cabinet"  
 
damn you silly wiki tutorial    
 
 (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:  missing "" on these 
SetSwingDoorLocked(cabinet, false, true); 
PlaySoundAtEntity("", "unlock_door", cabinet, 0, false); 
RemoveItem(CrowbarForCabinet); Oh i just noticed, it's not only for the CrowbarForCabinet, i've missed at "cabinet" and "cabinet"  
 
damn you silly wiki tutorial    Well atleast the map loads, but the goddamn crowbar aint opening the closet    i'm not sure if you can open/lock closet, but you can create another open, inactive one. so when you use crowbar on the locked closet. you active the one thats open. or wait until someone who know if that possible responds
			  
			
			
 
			
				
(This post was last modified: 06-18-2012, 11:55 AM by Rownbear.)
 
				
			 
		 |  
	 
 | 
 
	| 06-18-2012, 11:54 AM  | 
	
		
	 | 
 
 
	
		
		Adny 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,766 
	Threads: 6 
	Joined: Mar 2012
	
 Reputation: 
173
		
	 | 
	
		
			
RE: Crowbar unlocks a closet, doesen't work. 
			 
			
				void OnStart() 
{ 
AddUseItemCallback("", "CrowbarForCabinet", "cabinet", "OpenCabinetDoor", true);	 
} 
 
void OpenCabinetDoor(string &in asItem, string &in asEntity) // changed (string &in door) to (string &in asEntity) 
{ 
SetSwingDoorLocked("cabinet", false, true); ///missing quotes on cabinet 
PlaySoundAtEntity("", "unlock_door", "cabinet", 0, false); ///missing quotes on cabinet 
RemoveItem("CrowbarForCabinet"); //missing quotes on CrowbarForCabinet 
} 
 
 
void CeilingDoorLocked(string &in entity) 
{ 
if(GetSwingDoorLocked("CeilingDoor") == true) 
{ 
SetMessage("Messages", "PopupCeilingDoor", 0); 
} 
}
			 
			
			
 
I rate it 3 memes. 
			
		 |  
	 
 | 
 
	| 06-18-2012, 11:58 AM  | 
	
		
	 | 
 
 
	
		
		MaZiCUT 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 536 
	Threads: 31 
	Joined: Jun 2012
	
 Reputation: 
17
		
	 | 
	
		
			
RE: Crowbar unlocks a closet, doesen't work. 
			 
			
				 (06-18-2012, 11:54 AM)Rownbear Wrote:   (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:  missing "" on these 
SetSwingDoorLocked(cabinet, false, true); 
PlaySoundAtEntity("", "unlock_door", cabinet, 0, false); 
RemoveItem(CrowbarForCabinet); Oh i just noticed, it's not only for the CrowbarForCabinet, i've missed at "cabinet" and "cabinet"  
 
damn you silly wiki tutorial    
 
 (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:  missing "" on these 
SetSwingDoorLocked(cabinet, false, true); 
PlaySoundAtEntity("", "unlock_door", cabinet, 0, false); 
RemoveItem(CrowbarForCabinet); Oh i just noticed, it's not only for the CrowbarForCabinet, i've missed at "cabinet" and "cabinet"  
 
damn you silly wiki tutorial    Well atleast the map loads, but the goddamn crowbar aint opening the closet    i'm not sure if you can open/lock closet, but you can create another open, inactive one. so when you use crowbar on the locked closet. you active the one thats open. or wait until someone who know if that possible responds I've played custom stories where you open up a closet with a crowbar, but prehaps the open one was "inactive" 
 
So how exactly do i script that.. 
 
 (06-18-2012, 11:58 AM)andyrockin123 Wrote:  void OnStart() 
{ 
AddUseItemCallback("", "CrowbarForCabinet", "cabinet", "OpenCabinetDoor", true);	 
} 
 
void OpenCabinetDoor(string &in asItem, string &in asEntity) // changed (string &in door) to (string &in asEntity) 
{ 
SetSwingDoorLocked("cabinet", false, true); ///missing quotes on cabinet 
PlaySoundAtEntity("", "unlock_door", "cabinet", 0, false); ///missing quotes on cabinet 
RemoveItem("CrowbarForCabinet"); //missing quotes on CrowbarForCabinet 
} 
 
 
void CeilingDoorLocked(string &in entity) 
{ 
if(GetSwingDoorLocked("CeilingDoor") == true) 
{ 
SetMessage("Messages", "PopupCeilingDoor", 0); 
} 
} I fixed that, but read all the other posts, rownbear has a good idea.
			 
			
			
 
Hi. 
			
				
(This post was last modified: 06-18-2012, 11:59 AM by MaZiCUT.)
 
				
			 
		 |  
	 
 | 
 
	| 06-18-2012, 11:58 AM  | 
	
		
	 | 
 
 
	
		
		Adny 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,766 
	Threads: 6 
	Joined: Mar 2012
	
 Reputation: 
173
		
	 | 
	
		
			
RE: Crowbar unlocks a closet, doesen't work. 
			 
			
				 (06-18-2012, 11:54 AM)Rownbear Wrote:   (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:     i'm not sure if you can open/lock closet, but you can create another open, inactive one. so when you use crowbar on the locked closet. you active the one thats open. or wait until someone who know if that possible responds I can confirm that you can lock/unlock closets.
			  
			
			
 
I rate it 3 memes. 
			
				
(This post was last modified: 06-18-2012, 12:00 PM by Adny.)
 
				
			 
		 |  
	 
 | 
 
	| 06-18-2012, 11:59 AM  | 
	
		
	 | 
 
 
	
		
		MaZiCUT 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 536 
	Threads: 31 
	Joined: Jun 2012
	
 Reputation: 
17
		
	 | 
	
		
			
RE: Crowbar unlocks a closet, doesen't work. 
			 
			
				 (06-18-2012, 11:59 AM)andyrockin123 Wrote:   (06-18-2012, 11:54 AM)Rownbear Wrote:   (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:     i'm not sure if you can open/lock closet, but you can create another open, inactive one. so when you use crowbar on the locked closet. you active the one thats open. or wait until someone who know if that possible responds I can confirm that you can lock/unlock closets. I fixed the quotes but it won't unlock  (
			 
			
			
 
Hi. 
			
		 |  
	 
 | 
 
	| 06-18-2012, 12:01 PM  | 
	
		
	 | 
 
 
	
		
		Adny 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,766 
	Threads: 6 
	Joined: Mar 2012
	
 Reputation: 
173
		
	 | 
	
		
			
RE: Crowbar unlocks a closet, doesen't work. 
			 
			
				 (06-18-2012, 11:58 AM)CrazyArts Wrote:   (06-18-2012, 11:54 AM)Rownbear Wrote:   (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:    
 (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:    
    (06-18-2012, 11:58 AM)andyrockin123 Wrote:  void OnStart() 
{ 
AddUseItemCallback("", "CrowbarForCabinet", "cabinet", "OpenCabinetDoor", true);	 
} 
 
void OpenCabinetDoor(string &in asItem, string &in asEntity) // changed (string &in door) to (string &in asEntity) 
{ 
SetSwingDoorLocked("cabinet", false, true); ///missing quotes on cabinet 
PlaySoundAtEntity("", "unlock_door", "cabinet", 0, false); ///missing quotes on cabinet 
RemoveItem("CrowbarForCabinet"); //missing quotes on CrowbarForCabinet 
} 
 
 
void CeilingDoorLocked(string &in entity) 
{ 
if(GetSwingDoorLocked("CeilingDoor") == true) 
{ 
SetMessage("Messages", "PopupCeilingDoor", 0); 
} 
} I fixed that, but read all the other posts, rownbear has a good idea. Not quite; please check again. The function " 
OpenCabinetDoor " has inproper syntax which is why its not working. It shouldn't be:
 (string &in asItem, string &in door)
I revised it to 
 (string &in asItem, string &in asEntity) 
			 
			
			
 
I rate it 3 memes. 
			
		 |  
	 
 | 
 
	| 06-18-2012, 12:03 PM  | 
	
		
	 | 
 
 
	
		
		MaZiCUT 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 536 
	Threads: 31 
	Joined: Jun 2012
	
 Reputation: 
17
		
	 | 
	
		
			
RE: Crowbar unlocks a closet, doesen't work. 
			 
			
				 (06-18-2012, 12:03 PM)andyrockin123 Wrote:   (06-18-2012, 11:58 AM)CrazyArts Wrote:   (06-18-2012, 11:54 AM)Rownbear Wrote:   (06-18-2012, 11:48 AM)CrazyArts Wrote:   (06-18-2012, 11:44 AM)Rownbear Wrote:    
 (06-18-2012, 11:48 AM)CrazyArts Wrote:   
    (06-18-2012, 11:58 AM)andyrockin123 Wrote:  void OnStart() 
{ 
AddUseItemCallback("", "CrowbarForCabinet", "cabinet", "OpenCabinetDoor", true);	 
} 
 
void OpenCabinetDoor(string &in asItem, string &in asEntity) // changed (string &in door) to (string &in asEntity) 
{ 
SetSwingDoorLocked("cabinet", false, true); ///missing quotes on cabinet 
PlaySoundAtEntity("", "unlock_door", "cabinet", 0, false); ///missing quotes on cabinet 
RemoveItem("CrowbarForCabinet"); //missing quotes on CrowbarForCabinet 
} 
 
 
void CeilingDoorLocked(string &in entity) 
{ 
if(GetSwingDoorLocked("CeilingDoor") == true) 
{ 
SetMessage("Messages", "PopupCeilingDoor", 0); 
} 
} I fixed that, but read all the other posts, rownbear has a good idea. Not quite; please check again. The function " 
OpenCabinetDoor " has inproper syntax which is why its not working. It shouldn't be: 
 
(string &in asItem, string &in door) 
 
I revised it to  
 
(string &in asItem, string &in asEntity)  I did that too but the crowbar doesen't unclock the closet   
			 
			
			
 
Hi. 
			
		 |  
	 
 | 
 
	| 06-18-2012, 12:04 PM  | 
	
		
	 | 
 
 
	 
 |