The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Key Problem
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#1
Key Problem

Hey, Me once again with another problem but it seems easy to fix. Just to hard for me.

Anyways I Have 2 Keys and each key unlocks a different door the problem is when i unlock one door the other one unlocks as well. because I don't know how to separate the code in the script,

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("LockedDoor_1", false, true);
    PlaySoundAtEntity("", "unlock_door", "LockedDoor_1", 0, false);
    RemoveItem("LockedDoorKey");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("Door_2", false, true);
    PlaySoundAtEntity("", "unlock_door", "Door_2", 0, false);
    RemoveItem("Key_2");
}

I had that first, and it said I cannot use it because that prefix was already being used. So I did this.

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("LockedDoor_1", false, true);
    PlaySoundAtEntity("", "unlock_door", "LockedDoor_1", 0, false);
    RemoveItem("LockedDoorKey");

    SetSwingDoorLocked("Door_2", false, true);
    PlaySoundAtEntity("", "unlock_door", "Door_2", 0, false);
    RemoveItem("Key_2");
}

But that Didn't work either.
Thank you for helping in Advance
-Grey Fox (The Noob)

Current Project
Forgotten
07-13-2011, 10:39 PM
Find


Messages In This Thread
Key Problem - by GreyFox - 07-13-2011, 10:39 PM
RE: Key Problem - by SkuLLfac3 - 07-13-2011, 10:54 PM
RE: Key Problem - by xtron - 07-13-2011, 11:20 PM
RE: Key Problem - by GreyFox - 07-13-2011, 11:38 PM
RE: Key Problem - by SkuLLfac3 - 07-14-2011, 12:12 AM
RE: Key Problem - by Zypherzemus - 07-14-2011, 02:09 AM
RE: Key Problem - by xtron - 07-14-2011, 03:04 AM
RE: Key Problem - by GreyFox - 07-15-2011, 03:07 PM



Users browsing this thread: 3 Guest(s)