Results 1 to 4 of 4

Thread: Drop a model

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    To get the position your player is looking to, try this:

    https://github.com/kungfooman/cod2_s...utils.gsc#L203

    PHP Code:

    getRealEye
    ()
    {
        
    player self;

        
    stance player getStance();
        
        
    offset 0;
        switch (
    stance)
        {
            case 
    "stand"offset =  20; break;
            case  
    "duck"offset =   0; break;
            case   
    "lie"offset = -30; break;
            
    //default: offset = getcvarint("offset");
        
    }

        
    realEye player getEye() + (0,0,offset);
        return 
    realEye;
    }

    lookAtRaw()
    {
        
    player self;
        
        
    originStart player getRealEye();
        
    //originStart = player getTagOrigin("j_head");
        //originStart = player getTagOrigin("tag_aim");

        
    angles player getPlayerAngles();
        
    forward anglesToForward(angles);

        
    originEnd originStart vectorScale(forward100000);

        
    trace bullettrace(originStartoriginEndfalseundefined);

        if (
    trace["fraction"] == 1)
            return 
    undefined;

        return 
    trace;

    The getStance() function needs libcod though.

    You still need to add a distance check, like replacing

    PHP Code:
        originEnd originStart vectorScale(forward100000); 
    with

    PHP Code:
        originEnd originStart vectorScale(forward100); 
    If you can't run libcod, replace getRealEye() with getEye().
    timescale 0.01

  2. The Following User Says Thank You to kung foo man For This Useful Post:

    Mitch (31st May 2015)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •