setting player crosshair

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

setting player crosshair

Postby D3CEPTION » Mon Apr 25, 2016 8:19 am

was looking around at some engine functions and couldnt get this one to work in csgo, but it wasnt marked as such?

Code: Select all

import players
import random
@OnTick
def aa():
   engine_server.crosshair_angle(players.entity.Player(1).edict,random.randint(-90,90),random.randint(0,360))
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: setting player crosshair

Postby Ayuto » Mon Apr 25, 2016 10:29 am

Just tried that method in CS:S and wasn't able to get it working neither. Do you want the player to look at something specific? If yes, the Player class has a few properties to do that (view_angle, view_coordinates, view_player and view_entity).
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Re: setting player crosshair

Postby D3CEPTION » Mon Apr 25, 2016 10:54 am

it should do the same as set view_angle anyway :/ i was trying to see if i could set view to another entity and yet adopt its crosshairdata.
ofc this would be limited to tickrate, butim generally trying to understand the engine module here, im also wondering why there is this function:

Code: Select all

.def("is_in_edit_mode",
         &IVEngineServer::IsInEditMode,
         "Returns false if the engine is not in hammer editing mode."
      )


i know that its just a return, but if you could set the server into hammer edit mode anywhere, imagine the things that were possible. so i guess, the engine module carries some unusable "left overs" from the sdk regarding source pythons' usage?
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: setting player crosshair

Postby Ayuto » Mon Apr 25, 2016 4:44 pm

D3CEPTION wrote:so i guess, the engine module carries some unusable "left overs" from the sdk regarding source pythons' usage?

Yeah, we just exposed everything that the SDK provides and now slowly remove redundant functions. is_in_edit_mode() is probably a good candidate.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: Bing [Bot] and 131 guests