08-25-2011, 07:12 PM
My game keeps crashing when I try to test something out, its a script related problem, I know, but I dont know wat is wrong, I cant find wat is causing the problem, I was making a key for a door, and when I tried to test it, it crashed.
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("MetalKey", "Door1", "Func01", false);
}
void Func01(string &in asItem, string &in asEntity)
{
RemoveItem(MetalKey);
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
It crashes and sais MetalKey is not defined. wtf?
}
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("MetalKey", "Door1", "Func01", false);
}
void Func01(string &in asItem, string &in asEntity)
{
RemoveItem(MetalKey);
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
It crashes and sais MetalKey is not defined. wtf?
}