RE: Help a newbie with an HPS file?
Alright, I see where you went wrong. You can't stuff more information into 1 callback than what is allowed; you put 2 items (keys) and 2 entities (doors in this case) into 1 callback (AddUseItemCallback). Also, the syntax (stuff inside the parentheses) for UsedKeyOnDoor is wrong. This needs to be 2 callbacks and 2 functions, not one. Also, is it irondoor_key or irondoorkey? You have 2 different names.
Anyways, here's the revised script:
void OnStart()
{
AddUseItemCallback("", "irondoor_key", "irondoor" "use_iron_key", true);
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "use_monster_key", true);
}
void use_iron_key(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("irondoor" false, true);
PlaySoundAtEntity("", "unlock_door", "irondoor" 0, false);
RemoveItem("irondoor_key");
}
void use_monster_key(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "monsterdoor", 0, false);
RemoveItem("monsterdoorkey_1");
}
I rate it 3 memes.
|