| 
		
	
		| jmayo   Junior Member
 
 Posts: 16
 Threads: 6
 Joined: Sep 2011
 Reputation: 
0
 | 
			| Key On Door Error 
 
				I Tried scripting A Key To Open On a Door But It Crashes And Gives me This Error: ![[Image: errorkx.png]](http://img21.imageshack.us/img21/813/errorkx.png) [/URL]
 
Here Is What I Used:
 ////////////////////////////// Run first time starting mapvoid OnStart(){    AddUseItemCallback(**, *Prisonkey_1*, *Prison_1*, *keyondoor*, True);}    void Myfunc(string &in asItem, string &in asEntity) {    Setswingdoorlocked("prison_1", False, True);    Playsoundatentity("", "Unlock_door", "prison_1", 0, false);    Removeitem("prisonkey_1"); }////////////////////////////// Run when entering mapvoid OnEnter(){ } ////////////////////////////// Run when leaving mapvoid OnLeave(){ }
Please Help
			
				
(This post was last modified: 10-05-2011, 09:10 PM by jmayo.)
 |  |  
	| 10-05-2011, 06:43 PM |  |  
	
		| Khyrpa   Senior Member
 
 Posts: 638
 Threads: 10
 Joined: Apr 2011
 Reputation: 
24
 |  |  
	| 10-05-2011, 06:48 PM |  |  
	
		| Elven   Posting Freak
 
 Posts: 862
 Threads: 37
 Joined: Aug 2011
 Reputation: 
26
 | 
			| RE: [Help!]Key On Door Error 
 
 |  |  
	| 10-05-2011, 06:50 PM |  |  
	
		| jmayo   Junior Member
 
 Posts: 16
 Threads: 6
 Joined: Sep 2011
 Reputation: 
0
 | 
			| RE: [Help!]Key On Door Error 
 
				I Know How to Script Its Just There is A Error I Looked at a Video Step By Step And POW! ERROR
			 |  |  
	| 10-05-2011, 06:52 PM |  |  
	
		| Elven   Posting Freak
 
 Posts: 862
 Threads: 37
 Joined: Aug 2011
 Reputation: 
26
 | 
			| RE: [Help!]Key On Door Error 
 
				But you need to know basic idea of scripting already. You do not have that because you just used MyFuct with copy paste   !
			
 |  |  
	| 10-05-2011, 07:01 PM |  |  
	
		| Your Computer   SCAN ME!
 
 Posts: 3,456
 Threads: 32
 Joined: Jul 2011
 Reputation: 
235
 | 
			| RE: [Help!]Key On Door Error 
 
				 (10-05-2011, 06:52 PM)jmayo Wrote:  I Know How to Script Its Just There is A Error I Looked at a Video Step By Step And POW! ERROR 
Your script implies that you need to study scripting. You're not supposed to use asterisks in place of quotation marks. Likewise, you can't skimp out on case sensitivity. Function names are supposed to be spelled exactly as you see them in the wiki. Also, if you want to use 'True' and 'False' in place of 'true' and 'false', add this at the top of your script:
 const bool True = true;const bool False = false;
 
 
				
(This post was last modified: 10-05-2011, 07:05 PM by Your Computer.)
 |  |  
	| 10-05-2011, 07:03 PM |  |  
	
		| Elven   Posting Freak
 
 Posts: 862
 Threads: 37
 Joined: Aug 2011
 Reputation: 
26
 | 
			| RE: [Help!]Key On Door Error 
 
				Wooh, new thing what even I didn't know :3! But I prefer using lowercase true or false   
 |  |  
	| 10-05-2011, 07:09 PM |  |  
	
		| jmayo   Junior Member
 
 Posts: 16
 Threads: 6
 Joined: Sep 2011
 Reputation: 
0
 | 
			| RE: [Help!]Key On Door Error 
 
				 (10-05-2011, 07:03 PM)Your Computer Wrote:   (10-05-2011, 06:52 PM)jmayo Wrote:  I Know How to Script Its Just There is A Error I Looked at a Video Step By Step And POW! ERROR Your script implies that you need to study scripting. You're not supposed to use asterisks in place of quotation marks. Likewise, you can't skimp out on case sensitivity. Function names are supposed to be spelled exactly as you see them in the wiki. Also, if you want to use 'True' and 'False' in place of 'true' and 'false', add this at the top of your script:
 
 const bool True = true;const bool False = false;
 Thx I Edited My scipt Now its Only 1 Error:
 ![[Image: errorik.png]](http://img269.imageshack.us/img269/332/errorik.png)  |  |  
	| 10-05-2011, 07:20 PM |  |  
	
		| Your Computer   SCAN ME!
 
 Posts: 3,456
 Threads: 32
 Joined: Jul 2011
 Reputation: 
235
 | 
			| RE: [Help!]Key On Door Error 
 
				 (10-05-2011, 07:20 PM)jmayo Wrote:  Thx I Edited My scipt Now its Only 1 Error: 
You're going to need to post your updated code in order for me to figure what the issue is. It looks like you forgot to close something, but i can't tell for sure. 
			 
 |  |  
	| 10-05-2011, 07:24 PM |  |  
	
		| jmayo   Junior Member
 
 Posts: 16
 Threads: 6
 Joined: Sep 2011
 Reputation: 
0
 | 
			| RE: [Help!]Key On Door Error 
 
				////////////////////////////
 // Run first time starting map
 void OnStart()
 {
 AddUseItemCallback("", "Prisonkey_1", *prison_1", "keyondoor", true);
 }
 void Myfunc(string &in asItem, string &in asEntity)
 {
 Setswingdoorlocked("prison_1", false, true);
 Playsoundatentity("", "unlock_door", "prison_1", 0, false);
 Removeitem("Prisonkey_1");
 }
 ////////////////////////////
 // Run when entering map
 void OnEnter()
 {
 
 }
 
 ////////////////////////////
 // Run when leaving map
 void OnLeave()
 {
 
 }
 
 And Yes Prisonkey Starts With a Capital
 |  |  
	| 10-05-2011, 07:24 PM |  |  |