All pastes #515853 Raw Edit

Stuff

public text v1 · immutable
#515853 ·published 2007-05-28 12:11 UTC
rendered paste body
function ccSWEPSpawn( ply, cmd, args )
 
    if( ply:IsSuperAdmin() or ply:IsAdmin() ) then
   
        local tr = { }
        tr.start = ply:EyePos();
        tr.endpos = ply:EyePos() + 120 * ply:GetAimVector();
        tr.filter = ply;
       
        local trace = util.TraceLine( tr );
   
        local weap = ents.Create( args[1] );
        weap:SetPos( trace.HitPos );
        weap:Spawn();
       
   
    end
 
end
concommand.Add( "gm_giveswep", ccSWEPSpawn );