| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
hpl2:tutorials:script:buttons_that_open_a_door [2011/07/13 23:43] xtron |
hpl2:tutorials:script:buttons_that_open_a_door [2013/05/24 11:10] (current) grunt44432 |
||
|---|---|---|---|
| Line 2: | Line 2: | ||
| - | Today I (xtron) will teach you (the reader) how to make lets say press 3buttons and a door opens. | + | Today I (xtron) will teach you (the reader) how to make lets say press 4 buttons and a door opens. |
| Line 42: | Line 42: | ||
| <code cpp> | <code cpp> | ||
| - | |||
| SetLocalVarInt("Var1", 0); | SetLocalVarInt("Var1", 0); | ||
| - | |||
| - | |||
| SetEntityPlayerInteractCallback("button1", "func1", true); | SetEntityPlayerInteractCallback("button1", "func1", true); | ||
| - | |||
| - | |||
| SetEntityPlayerInteractCallback("button2", "func2", true); | SetEntityPlayerInteractCallback("button2", "func2", true); | ||
| - | |||
| - | |||
| SetEntityPlayerInteractCallback("button3", "func3", true); | SetEntityPlayerInteractCallback("button3", "func3", true); | ||
| - | |||
| - | |||
| SetEntityPlayerInteractCallback("button4", "func4", true); | SetEntityPlayerInteractCallback("button4", "func4", true); | ||
| </code> | </code> | ||
| Line 67: | Line 58: | ||
| func5(); | func5(); | ||
| } | } | ||
| - | |||
| void func2(string &in asEntity) | void func2(string &in asEntity) | ||
| Line 74: | Line 64: | ||
| func5(); | func5(); | ||
| } | } | ||
| - | |||
| void func3(string &in asEntity) | void func3(string &in asEntity) | ||
| Line 81: | Line 70: | ||
| func5(); | func5(); | ||
| } | } | ||
| - | |||
| void func4(string &in asEntity) | void func4(string &in asEntity) | ||
| Line 88: | Line 76: | ||
| func5(); | func5(); | ||
| } | } | ||
| - | |||
| void func5() | void func5() | ||
| Line 116: | Line 103: | ||
| SetEntityPlayerInteractCallback("button4", "func4", true); | SetEntityPlayerInteractCallback("button4", "func4", true); | ||
| } | } | ||
| - | |||
| void func1(string &in asEntity) | void func1(string &in asEntity) | ||
| Line 123: | Line 109: | ||
| func5(); | func5(); | ||
| } | } | ||
| - | |||
| void func2(string &in asEntity) | void func2(string &in asEntity) | ||
| Line 130: | Line 115: | ||
| func5(); | func5(); | ||
| } | } | ||
| - | |||
| void func3(string &in asEntity) | void func3(string &in asEntity) | ||
| Line 137: | Line 121: | ||
| func5(); | func5(); | ||
| } | } | ||
| - | |||
| void func4(string &in asEntity) | void func4(string &in asEntity) | ||
| Line 144: | Line 127: | ||
| func5(); | func5(); | ||
| } | } | ||
| - | |||
| void func5() | void func5() | ||