My server runs a custom gamemode, with no sandbox elements.
I want admins to be able to spawn the [url=http://www.garrysmod.org/downloads/?a=view&id=88535]PlayX[/url] entity, even if using Rcon.
Is this possible? The entity name in the folder is just PlayX
So I'm guessing this is impossible?
:}
Put this in lua/autorun/server
[code]concommand.Add("SpawnPlayX",function( ply )
if (!ply:IsAdmin()) then return end
local ent = ents.Create("PlayX")
local tr = ply:GetEyeTrace()
ent:SetPos( tr.HitPos + tr.HitNormal * 100 )
ent:SetAng( tr.HitNormal:Angle() )
ent:Spawn()
ent:Activate()
end)[/code]
Untested.
Most likely PlayX uses base_gmodentity as the ent base so it won't work unless he's deriving from Sandbox.
[QUOTE=JIAC;21385595]Most likely PlayX uses base_gmodentity as the ent base so it won't work unless he's deriving from Sandbox.[/QUOTE]
Nope it uses base_anim