From de862aa3484ec7434343de943e6c93550c43e141 Mon Sep 17 00:00:00 2001 From: IR4T4 Date: Wed, 17 Feb 2016 20:30:00 +0100 Subject: [PATCH] et_LuaSpawnEntitiesFromString example --- TESTS/test.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TESTS/test.lua b/TESTS/test.lua index d26741a..f42feb6 100644 --- a/TESTS/test.lua +++ b/TESTS/test.lua @@ -16,6 +16,8 @@ qboolean G_LuaHook_UpgradeSkill(int cno, skillType_t skill); qboolean G_LuaHook_SetPlayerSkill( int cno, skillType_t skill ); void G_LuaHook_Print( char *text ); qboolean G_LuaHook_Obituary( int victim, int killer, int meansOfDeath ); +qboolean G_LuaHook_Damage(int target, int attacker, int damage, int dflags, int mod); +void G_LuaHook_SpawnEntitiesFromString(); TODO: Check the vars @@ -208,3 +210,9 @@ function et_SetPlayerSkill(_clientNum, _skill) et.G_Print(color .. "SetPlayerSkill - clientNum: " .. _clientNum .. " skill: " .. _skill .. "\n") end end + +-- example of spawning and deleting an entity +function et_LuaSpawnEntitiesFromString() + et.G_CreateEntity("scriptname \"dinghy1\" origin \"2650 600 100\" classname \"misc_gamemodel\" modelscale 1 contents 1 mins \"-90 -90 -25\" maxs \"90 90 25\" clipmask 1 model \"models/mapobjects/dinghy_sd/dinghy.md3\"") + et.G_DeleteEntity("scriptname \"dinghy1\"") +end