Both sides previous revision Previous revision | Next revision Both sides next revision | ||
hpl2:tutorials:script:levers_and_secretshelfs [2011/07/14 01:49] xtron |
hpl2:tutorials:script:levers_and_secretshelfs [2011/07/14 01:49] xtron |
||
---|---|---|---|
Line 97: | Line 97: | ||
SetEntityConnectionStateChangeCallback("lever", "func_shelf"); | SetEntityConnectionStateChangeCallback("lever", "func_shelf"); | ||
} | } | ||
- | + | ||
+ | |||
void func_shelf(string &in asEntity, int alState) | void func_shelf(string &in asEntity, int alState) | ||
{ | { | ||
Line 111: | Line 111: | ||
- | ===== More Then One Lever ===== | + | ===== More Than One Lever ===== |
Line 121: | Line 121: | ||
<code cpp> | <code cpp> | ||
- | + | ||
SetLocalVarInt("Var1", 0); | SetLocalVarInt("Var1", 0); | ||
- | + | ||
+ | |||
SetEntityConnectionStateChangeCallback("lever_1", "func_shelf_1"); | SetEntityConnectionStateChangeCallback("lever_1", "func_shelf_1"); | ||
</code> | </code> | ||
Line 136: | Line 135: | ||
- | <code cpp> | + | <code cpp>void func_shelf(string &in asEntity, int alState) |
- | void func_shelf(string &in asEntity, int alState) | + | |
{ | { | ||
if (alState == 1) | if (alState == 1) | ||
Line 145: | Line 143: | ||
} | } | ||
} | } | ||
- | + | ||
+ | |||
void func_shelf_1(string &in asEntity, int alState) | void func_shelf_1(string &in asEntity, int alState) | ||
{ | { | ||
Line 155: | Line 153: | ||
} | } | ||
} | } | ||
- | + | ||
+ | |||
void func01() | void func01() | ||
{ | { | ||
Line 177: | Line 175: | ||
- | <code cpp> | + | <code cpp>void OnStart() |
- | void OnStart() | + | |
{ | { | ||
SetLocalVarInt("Var1", 0); | SetLocalVarInt("Var1", 0); | ||
Line 184: | Line 181: | ||
SetEntityConnectionStateChangeCallback("lever_1", "func_shelf_1"); | SetEntityConnectionStateChangeCallback("lever_1", "func_shelf_1"); | ||
} | } | ||
- | + | ||
+ | |||
void func_shelf(string &in asEntity, int alState) | void func_shelf(string &in asEntity, int alState) | ||
{ | { | ||
Line 194: | Line 191: | ||
} | } | ||
} | } | ||
- | + | ||
+ | |||
void func_shelf_1(string &in asEntity, int alState) | void func_shelf_1(string &in asEntity, int alState) | ||
{ | { | ||
Line 204: | Line 201: | ||
} | } | ||
} | } | ||
- | + | ||
+ | |||
void func01() | void func01() | ||
{ | { |