116 HideMission; |
116 HideMission; |
117 lc_hidemission:= 0; |
117 lc_hidemission:= 0; |
118 end; |
118 end; |
119 |
119 |
120 function lc_spawnhealthcrate(L: Plua_State) : LongInt; Cdecl; |
120 function lc_spawnhealthcrate(L: Plua_State) : LongInt; Cdecl; |
121 var x, y: LongInt; |
|
122 begin |
121 begin |
123 if lua_gettop(L) <> 2 then begin |
122 if lua_gettop(L) <> 2 then begin |
124 LuaError('Lua: Wrong number of parameters passed to SpawnHealthCrate!'); |
123 LuaError('Lua: Wrong number of parameters passed to SpawnHealthCrate!'); |
125 lua_pushnil(L); |
124 lua_pushnil(L); |
126 end |
125 end |
127 else begin |
126 else begin |
128 x:= lua_tointeger(L, 1); |
127 SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), |
129 y:= lua_tointeger(L, 2); |
128 HealthCrate, 0); |
130 cCaseFactor := 0; |
|
131 SpawnHealthCrate(x, y); |
|
132 end; |
129 end; |
133 lc_spawnhealthCrate := 1; |
130 lc_spawnhealthcrate := 1; |
|
131 end; |
|
132 |
|
133 function lc_spawnammocrate(L: PLua_State): LongInt; Cdecl; |
|
134 begin |
|
135 if lua_gettop(L) <> 3 then begin |
|
136 LuaError('Lua: Wrong number of parameters passed to SpawnAmmoCrate!'); |
|
137 lua_pushnil(L); |
|
138 end |
|
139 else begin |
|
140 SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), |
|
141 AmmoCrate, lua_tointeger(L, 3)); |
|
142 end; |
|
143 lc_spawnammocrate := 1; |
|
144 end; |
|
145 |
|
146 function lc_spawnutilitycrate(L: PLua_State): LongInt; Cdecl; |
|
147 begin |
|
148 if lua_gettop(L) <> 3 then begin |
|
149 LuaError('Lua: Wrong number of parameters passed to SpawnUtilityCrate!'); |
|
150 lua_pushnil(L); |
|
151 end |
|
152 else begin |
|
153 SpawnCustomCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2), |
|
154 UtilityCrate, lua_tointeger(L, 3)); |
|
155 end; |
|
156 lc_spawnutilitycrate := 1; |
134 end; |
157 end; |
135 |
158 |
136 function lc_addgear(L : Plua_State) : LongInt; Cdecl; |
159 function lc_addgear(L : Plua_State) : LongInt; Cdecl; |
137 var gear : PGear; |
160 var gear : PGear; |
138 x, y, s, t: LongInt; |
161 x, y, s, t: LongInt; |
877 ScriptSetInteger(EnumToStr(am), ord(am)); |
900 ScriptSetInteger(EnumToStr(am), ord(am)); |
878 |
901 |
879 // register functions |
902 // register functions |
880 lua_register(luaState, 'AddGear', @lc_addgear); |
903 lua_register(luaState, 'AddGear', @lc_addgear); |
881 lua_register(luaState, 'SpawnHealthCrate', @lc_spawnhealthcrate); |
904 lua_register(luaState, 'SpawnHealthCrate', @lc_spawnhealthcrate); |
|
905 lua_register(luaState, 'SpawnAmmoCrate', @lc_spawnammocrate); |
|
906 lua_register(luaState, 'SpawnUtilityCrate', @lc_spawnutilitycrate); |
882 lua_register(luaState, 'WriteLnToConsole', @lc_writelntoconsole); |
907 lua_register(luaState, 'WriteLnToConsole', @lc_writelntoconsole); |
883 lua_register(luaState, 'GetGearType', @lc_getgeartype); |
908 lua_register(luaState, 'GetGearType', @lc_getgeartype); |
884 lua_register(luaState, 'EndGame', @lc_endgame); |
909 lua_register(luaState, 'EndGame', @lc_endgame); |
885 lua_register(luaState, 'FindPlace', @lc_findplace); |
910 lua_register(luaState, 'FindPlace', @lc_findplace); |
886 lua_register(luaState, 'SetGearPosition', @lc_setgearposition); |
911 lua_register(luaState, 'SetGearPosition', @lc_setgearposition); |