User Tools

Site Tools


hpl2:tutorials:script:scripting_by_xtron_-_item_that_unlocks_a_door

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl2:tutorials:script:scripting_by_xtron_-_item_that_unlocks_a_door [2012/06/23 16:10]
silentstriker [THE SCRIPT]
hpl2:tutorials:script:scripting_by_xtron_-_item_that_unlocks_a_door [2013/08/22 15:12] (current)
yourcomputer Corrected references
Line 76: Line 76:
 <code cpp>void FUNCTION(string &in asItem, string &in asEntity) <code cpp>void FUNCTION(string &in asItem, string &in asEntity)
 { {
-    SetSwingDoorLocked(door, false, true); +    SetSwingDoorLocked(asEntity, false, true); 
-    PlaySoundAtEntity("",​ "​unlock_door", ​door, 0, false); +    PlaySoundAtEntity("",​ "​unlock_door", ​asEntity, 0, false); 
-    RemoveItem(item);+    RemoveItem(asItem);
 } }
 </​code>​ </​code>​
Line 106: Line 106:
 void FUNCTION(string &in asItem, string &in asEntity) void FUNCTION(string &in asItem, string &in asEntity)
 { {
-    SetSwingDoorLocked(door, false, true); +    SetSwingDoorLocked(asEntity, false, true); 
-    PlaySoundAtEntity("",​ "​unlock_door", ​door, 0, false); +    PlaySoundAtEntity("",​ "​unlock_door", ​asEntity, 0, false); 
-    RemoveItem(item);+    RemoveItem(asItem);
 } }
    
Line 120: Line 120:
  
  
-<​code>​''​void OnStart() {  AddUseItemCallback("",​ "​NAMEOFTHEITEM",​ "​NAMEOFTHEDOOR",​ "​FUNCTION",​ true); }  void FUNCTION(string &in asItem, string &in asEntity) {  SetSwingDoorLocked(asEntity,​ false, true); ​ PlaySoundAtEntity("",​ "​unlock_door",​ asEntity, 0, false); ​ RemoveItem(asItem);​ }''​+<​code ​cpp> 
 +void OnStart() 
 +{ 
 + AddUseItemCallback("",​ "​NAMEOFTHEITEM",​ "​NAMEOFTHEDOOR",​ "​FUNCTION",​ true); 
 +} 
 + 
 +void FUNCTION(string &in asItem, string &in asEntity) 
 +{ 
 + SetSwingDoorLocked(asEntity,​ false, true); 
 + PlaySoundAtEntity("",​ "​unlock_door",​ asEntity, 0, false); 
 + RemoveItem(asItem);​ 
 +}
 </​code>​ </​code>​
  
Line 137: Line 148:
  
  
-<font 10pt:​normal/​Arial;;​inherit;;​inherit >Edited by SilentStriker</​font>​+<font 10pt:​normal/​Arial;;​inherit;;​inherit ​   >Edited by SilentStriker</​font>​
  
hpl2/tutorials/script/scripting_by_xtron_-_item_that_unlocks_a_door.1340467817.txt.gz · Last modified: 2012/06/23 16:10 (external edit)