I have been setting up a large amount of path tracks in configuration files to be executed and spawn a path_track with the specified keys and values problem is the entities are supposed to stay at the player origin, and I can't for the life of me figure out how to set ulx to spawn the entity at user origin is there any way to do this.
I was looking at the code for the ulx_util.lua
function cc_ulxEnt( userid, args, argv, argc )
ulx_log( "Admin " .. ulx_playerString( userid ) .. " created an ent, using these arguments: " .. args ) -- Log first incase it crashes
local class = argv[ 1 ]
table.remove( argv, 1 ) -- We already have the first now
newEnt = _EntCreate( class )
local pos = _PlayerGetShootPos( userid )
local ang = _PlayerGetShootAng( userid )
_TraceLine( pos, ang, 4096, userid )
local vector = _TraceEndPos()
vector.z = vector.z + 20
debug( tostring( vector ) )
_EntSetKeyValue( newEnt, "origin", vector.x .. " " .. vector.y .. " " .. vector.z ) -- Note that the position can be overridden by the users's flags
for i,v in ipairs( argv ) do -- Loop through them
local key = string.sub( v, 1, string.find( v, ":" ) - 1 )
local value = string.sub( v, string.find( v, ":" ) + 1 )
_EntSetKeyValue( newEnt, key, value )
end
_EntSpawn( newEnt )
end
ULX_CONCOMMAND( "ulx_ent", cc_ulxEnt, ACCESS_ENT, "<classname> <flag> .. - spawn an ent, separate flag and value with : ( IE: ulx_ent prop_ragdoll model:models/alyx.mdl )", 1 )
This portion of the line
Note that the position can be overridden by the users's flags
leads me to believe that you can some how
if it isnt possible with the current command code is it possible for someone to rewrite the code here to do so so that i can add it to the ulx_util.lua file as another command
Thanks