05-21-2011, 08:58 PM
Hello ,
I need help with a script -to do with variables, Ive never used them
before- and when the player interacts with a lever nothing happens when I want a message when door = 0 but nothing happens, I hope you can help
I need help with a script -to do with variables, Ive never used them
before- and when the player interacts with a lever nothing happens when I want a message when door = 0 but nothing happens, I hope you can help
Code:
//VARAIBLES
AddLocalVarInt("door1", 0);
//FUNCTIONS
SetEntityPlayerInteractCallback("lever1", "used1", false);
Code:
void used1(string &in asParent, string &in asChild, int alState)
{
if(GetGlobalVarInt("door1")==1)
{
SetSwingDoorLocked("metal_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metal_1", 0, false);
}
else
{
PlayGuiSound("21/21_lever_fail.ogg", 1);
SetMessage("Message", "mem8", 3);
}
}