• Spawn a STool on non-sandbox mode?
    6 replies, posted
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
It should work perfectly fine then.
[img]http://up.1337.jp/screenshots//nope.gif[/img]
Sorry, you need to Log In to post a reply to this thread.