View Single Post
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 06-20-2012 , 14:04   Re: [CSS] Get the angle between player and an entity
Reply With Quote #3

Here my code so far, I am not sure for the angle and I do not know what sort of filter I should put to detect a wall. Thank you for your help, it keep going foward!

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_WeaponEquipPostOnWeaponEquip);
}
    
public 
Action:OnWeaponEquip(clientweapon)
{
    
decl Float:clientOrigin[3], Float:clientOrigin[3], Float:tracePos[3],;
    
GetEntPropVector(clientProp_Send"m_vecOrigin"clientOrigin);
    
GetEntPropVector(weaponProp_Send"m_vecOrigin"weaponOrigin);
    
    
tracePos origin-weaponOrigin;
    new 
Handle:trace TR_TraceRayFilterEx(tracePosanglesMASK_SOLIDRayType_Infinite, ????);

    if(
TR_DidHit(trace))


Last edited by Mathias.; 06-20-2012 at 14:05.
Mathias. is offline