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.