[CSGO] player.view_coordinates issue

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

[CSGO] player.view_coordinates issue

Postby VinciT » Thu Apr 14, 2016 2:57 pm

For some reason, .view_coordinates doesn't fully follow the crosshair when it comes to looking all the way up or down, as you can see in this image:

Image

Syntax: Select all

#view_coords_test.py
from events import Event

from players.entity import Player
from players.helpers import index_from_userid

from effects import temp_entities
from filters.recipients import RecipientFilter
from engines.precache import Model


laser = Model('sprites/laserbeam.vmt')

@Event('weapon_fire')
def pewpew(game_event):
player = Player(index_from_userid(game_event.get_int('userid')))

start = player.eye_location
end = player.view_coordinates

temp_entities.beam_points(RecipientFilter(), 0, start, end, laser.index, laser.index, 0, 255, 5, 1, 1, 2, 0, 255, 255, 0, 75, 1)

I'm guessing this has something to do with the view_vector?
User avatar
Ayuto
Project Leader
Posts: 2209
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri Apr 15, 2016 1:34 pm

User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Postby VinciT » Fri Apr 15, 2016 5:10 pm

Awesome, thanks Ayuto!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 73 guests