et_LuaSpawnEntitiesFromString example

This commit is contained in:
IR4T4 2016-02-17 20:30:00 +01:00
parent e0f0e71daf
commit de862aa348

View file

@ -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