This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[L4D2] Change Player Angle and Position?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 09-14-2023 , 16:29   [L4D2] Change Player Angle and Position?
Reply With Quote #1

I'm trying to create a plugin that uses the player's aiming direction or angle and position, but it's crashing when I change the angle and position.

Here is the code.

PHP Code:
            float vPos[3], vAng[3];
            
GetEntPropVectorclientProp_Send"m_vecOrigin"vPos );
            
GetEntPropVectorclientProp_Data"m_angRotation"vAng );
            
            if(
vAng[0] < 11.40) return Plugin_Stop;
            
            
vPos[2] += altura;
            
vAng[0] = 12.00;

            
SetEntPropVectorclientProp_Send"m_angRotation"vAng );
            
TeleportEntity(clientvPosvAngNULL_VECTOR); 
I tested with SetEntPropVector and TeleportEntity, it didn't work for all attempts

If anyone can help, I would really appreciate it
__________________
_________________
Discord: gabrielbr007
YouTube: WhiteFire
Steam: WhiteFire
King_OXO is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-23-2023 , 09:52   Re: [L4D2] Change Player Angle and Position?
Reply With Quote #2

https://sm.alliedmods.net/new-api/cl...lientAbsOrigin

https://sm.alliedmods.net/new-api/sd...lientEyeAngles


https://sm.alliedmods.net/new-api/sd...TeleportEntity

PHP Code:

GetClientAbsOrigin
(clientvPos);
GetClientEyeAngles(clientvAng);

TeleportEntity(clientvPosvAngNULL_VECTOR); 
__________________
Do not Private Message @me
Bacardi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode