JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
Key! WHY YOU NO WORK!
Keys are the one of the most easy things I know how to script, but why the hell is it saying "Cannot Use Item This Way!" Here is my code, and I hawk-eyed it, saw nothing wrong, and someone else looked at it and ALSO saw nothing wrong! The key/door names are all correct, and the key has a subitemtext.
AddUseItemCallback("", "key_firstfloor", "firstfloordoor", "UsedKeyOnDoor", true);
---------------------------
void UsedKeyOnDoor(string &in asParent , string &in asChild , int alState)
{
SetLevelDoorLocked("firstfloordoor", false);
SetLevelDoorLockedSound("firstfloordoor", "door_level_wood_locked.snt");
RemoveItem("key_firstfloor");
}
(This post was last modified: 08-21-2011, 01:13 AM by JetlinerX.)
|
|
08-21-2011, 01:12 AM |
|
Elven
Posting Freak
Posts: 862
Threads: 37
Joined: Aug 2011
Reputation:
26
|
RE: Key! WHY YOU NO WORK!
SetSwingDoorLocked("DOORNAME", false, true);
(This post was last modified: 08-21-2011, 01:45 AM by Elven.)
|
|
08-21-2011, 01:45 AM |
|
Obliviator27
Posting Freak
Posts: 792
Threads: 10
Joined: Jul 2011
Reputation:
66
|
RE: Key! WHY YOU NO WORK!
(08-21-2011, 01:12 AM)JetlinerX Wrote: Keys are the one of the most easy things I know how to script, but why the hell is it saying "Cannot Use Item This Way!" Here is my code, and I hawk-eyed it, saw nothing wrong, and someone else looked at it and ALSO saw nothing wrong! The key/door names are all correct, and the key has a subitemtext.
AddUseItemCallback("", "key_firstfloor", "firstfloordoor", "UsedKeyOnDoor", true);
---------------------------
void UsedKeyOnDoor(string &in asParent , string &in asChild , int alState)
{
SetLevelDoorLocked("firstfloordoor", false);
SetLevelDoorLockedSound("firstfloordoor", "door_level_wood_locked.snt");
RemoveItem("key_firstfloor");
}
Improper Syntax. (string &in asItem, string &in asEntity) is what you want to use.
|
|
08-21-2011, 01:45 AM |
|
Elven
Posting Freak
Posts: 862
Threads: 37
Joined: Aug 2011
Reputation:
26
|
RE: Key! WHY YOU NO WORK!
Yeah that was second thing what I was about to say
|
|
08-21-2011, 01:46 AM |
|
JenniferOrange
Senior Member
Posts: 424
Threads: 43
Joined: Jun 2011
Reputation:
33
|
RE: Key! WHY YOU NO WORK!
(08-21-2011, 01:45 AM)Obliviator27 Wrote: Improper Syntax. (string &in asItem, string &in asEntity) is what you want to use.
HE IS RIGHT! I can't believe I never caught that x_x
Ba-da bing, ba-da boom.
|
|
08-21-2011, 04:00 AM |
|
Obliviator27
Posting Freak
Posts: 792
Threads: 10
Joined: Jul 2011
Reputation:
66
|
RE: Key! WHY YOU NO WORK!
[/quote]
HE IS RIGHT! I can't believe I never caught that x_x
[/quote]
It's scripting. Missing things happens, as I've found out very often. I've yet to type up a script that works without a Fatal Error.
|
|
08-21-2011, 04:14 AM |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
RE: Key! WHY YOU NO WORK!
Yep, thats why this community is so great Jennifer, if we dont spot it, you can be sure as hell someone else is willing to get it for you! Thanks all!
|
|
08-21-2011, 04:17 AM |
|
Juby
Senior Member
Posts: 290
Threads: 2
Joined: May 2011
Reputation:
5
|
RE: Key! WHY YOU NO WORK!
(08-21-2011, 04:17 AM)JetlinerX Wrote: Yep, thats why this community is so great Jennifer, if we dont spot it, you can be sure as hell someone else is willing to get it for you! Thanks all!
Attractive Wink
Insanity. Static.
|
|
08-21-2011, 05:37 AM |
|
|