(03-13-2013, 03:34 PM)JustAnotherPlayer Wrote: void OnStart()
{
AddUseItemCallback("", "StrangeDoorKey", "StrangeDoor", "UnlockStrangeDoor", false);
SetEntityCallbackFunc("GuestRoomKey", "ActiveEntity");
AddUseItemCallback("", "GuestRoomKey", "door01", "UnlockDoor", false);
}
void UnlockDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door01", 0, false);
RemoveItem("GuestRoomKey");
}
void ActiveEntity(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false);
StartScreenShake(0.5f, 2, 0, 0.25);
}
void UnlockStrangeDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("StrangeDoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "StrangeDoor", 0, false);
RemoveItem("StrangeDoorKey");
}
I don't know what is wrong. There is nothing wrong with it. The SetEntityCallbackFunc was correct. Taken from the script functions page;
void SetEntityCallbackFunc(string& asName, string& asCallback);
Since was the internal name and is stated as the callback.
Here's the most recent scriptings I've made
void OnStart ()
{
AddUseItemCallback("", "StrangeDoorKey", "door03", "UsedKeyOnDoor", false);
SetEntityCallbackFunc("GuestRoomKey", "jump");
AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}
void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false);
StartScreenShake(0.5f, 2, 0, 0.25);
GiveSanityDamage(5.0f, true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door03", false, true);
PlaySoundAtEntity("", "Unlock_door", "door03", 0, false);
RemoveItem("StrangeDoorKey");
}