Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Unlocking Door [HELP]
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Script Unlocking Door [HELP]

Never suggest to manually type the name of the door and item for the UsedKeyOnDoor function. That's bad programming. One of the reasons for the existence of functions is to not repeat yourself.

A proper function definition would be:
PHP Code: (Select All)
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntityfalsetrue);
    
PlaySoundAtEntity("""unlock_door"asEntity0false);
    
RemoveItem(asItem); // though this is unnecessary given the current use of AddUseItemCallback


Tutorials: From Noob to Pro
01-30-2012, 08:51 PM
Website Find


Messages In This Thread
Script Unlocking Door [HELP] - by wretic91 - 01-30-2012, 07:32 PM
RE: Script Unlocking Door [HELP] - by trollox - 01-30-2012, 07:35 PM
RE: Script Unlocking Door [HELP] - by wretic91 - 01-30-2012, 07:39 PM
RE: Script Unlocking Door [HELP] - by trollox - 01-30-2012, 08:04 PM
RE: Script Unlocking Door [HELP] - by wretic91 - 01-30-2012, 08:16 PM
RE: Script Unlocking Door [HELP] - by trollox - 01-30-2012, 08:52 PM
RE: Script Unlocking Door [HELP] - by Your Computer - 01-30-2012, 08:51 PM



Users browsing this thread: 1 Guest(s)