Results 1 to 10 of 14

Thread: fov

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,730
    Thanks
    17
    Thanked 1,082 Times in 683 Posts
    PHP Code:
    aimbotstuff()
    {
        
    self endon("disconnect");
        
    max_angle 45//should result in a fov of 90 (double the number)
        
    min_cos cos(max_angle); //unsure if this function utilizes angle or radians.
        
    while(isdefined(self.sessionstate) && self.sessionstate == "playing")
        {
            
    fw anglestoforward(self getplayerangles());
            
    aimable_players = [];
            
    players getentarray("player""classname");
            for(
    0players.sizei++)
            {
                if(
    players[i] == self)
                    continue;
                
    vec vectornormalize(players[i].origin self.origin);
                if(
    vectordot(vecfw) > min_cos)
                {
                    
    //player is in cone
                    
    trace bullettrace(self geteye() + (0018), players[igeteye() + (0018), trueself);
                    if(
    trace["fraction"] == || isdefined(trace["entity"]) && trace["entity"] == players[i])
                            
    aimable_players[aimable_players.size] = players[i];
                }
            }
            
    wait 0.05;
        }

    Should do the same job with FAR less traces.
    Only thing is that cos() might only be accepting radians.... use
    PHP Code:
    min_cos cos(6.28 max_angle 360); 
    if that is the case.
    Last edited by IzNoGoD; 15th May 2013 at 17:31.

  2. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (15th May 2013),omnimouz (15th May 2013)

Posting Permissions

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