Rules FAQ Members List Search Register Login

 Raised This Month: \$403 Target: \$400 100%

Solved help with vectors

Author Message
Touric
New Member
Join Date: Jul 2018
 07-14-2018 , 07:52   help with vectors #1 hello guys, i need help with a script: i'm trying to get the x and y of a point which is located 500 units from where i am and oriented with my eye angles: Code: ``` float clpos[3], eyeangles[3]; GetClientAbsOrigin(client, clpos); GetClientEyeAngles(client, eyeangles); eyeangles[2] = 0.0; //now i want to get the position 500 units further from where i am with the angles of my eyes``` Last edited by Touric; 07-14-2018 at 09:25.
mug1wara
AlliedModders Donor
Join Date: Jun 2018
 07-14-2018 , 08:40   Re: help with vectors #2 Use ur brain! Hopefully I did it aswell, most likely my sample is right. PHP Code: ``` float fPosition[3], fEyeAngles[3], fForward[3]; GetClientEyePosition(client, fPosition); GetClientEyeAngles(client, fEyeAngles); GetAngleVectors(fEyeAngles, fForward, NULL_VECTOR, NULL_VECTOR); fPosition[0] += fForward[0] * 500.0; fPosition[2] += fForward[2] * 500.0;  ``` __________________ Taking requests, add me on Steam. mug1wara.xyz People make themselves understood in a way, others understand in another.
1337norway
AlliedModders Donor
Join Date: Feb 2014
Location: USA
 07-14-2018 , 08:40   Re: help with vectors #3 PHP Code: ``` float distance = 500.0; float eyepos[3], eyeangles[3], direction[3], forwards[3], endpoint[3]; GetClientEyePosition(client, eyepos); GetClientEyeAngles(client, eyeangles); eyeangles[2] = 0.0; eyeangles[0] = 0.0; //only need this if you don't want to take pitch(x) into account and want a static yaw 500 units away from the player. GetVectorAngles(eyeangles, direction);   GetAngleVectors(direction, forwards, NULL_VECTOR, NULL_VECTOR);   for(int i = 0;i < 3; i++)       endpoint[i] = eyepos[i] + (forwards[i] * distance);  ``` __________________ Taking Free/Paid Requests! Send a PM --->Donate here if you like my work. <---
Touric
New Member
Join Date: Jul 2018
 07-14-2018 , 09:24   Re: help with vectors #4 Thanks guys <3
mug1wara
AlliedModders Donor
Join Date: Jun 2018
 07-14-2018 , 09:57   Re: help with vectors #5 No, thank you <3 __________________ Taking requests, add me on Steam. mug1wara.xyz People make themselves understood in a way, others understand in another.

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Server Discussion     Source Servers (SRCDS)     HL1 Servers (HLDS) AMX Mod X     News     Bug Reports     General     Off-Topic     Plugins         Suggestions / Requests         Approved Plugins         New Plugin Submissions         Unapproved/Old Plugins         Translation Request         High-Traffic Plugins             GunGame             UAIO (Ultimate All-In-One Plugin)             xREDIRECT             CSDM             AMX Super             RuneMod             Zombie Plague Mod             SuperHero Mod                 News                 Tech Support                 Scripting Help                 Off-Topic / General Chat                 Heroes                     Suggestions / Requests                     Approved Heroes                     New Submissions                     Unapproved/Old Heroes                         Module Heroes                     SuperHero Mod Stats - By 123                 (OLD) Bug Reports     Scripting         Scripting Help         Code Snippets/Tutorials         Module Coding     Donor Access SourceMod     News     General     Plugins         Plugins         Unapproved Plugins         Plugin/Gameplay Ideas and Requests         High-Traffic Plugins             SourceMod Anti-Cheat             Zombie:Reloaded             SourceBans             VSH / Freak Fortress             Store             SM_Hosties             HLstatsX:CE     Scripting     Extensions     Snippets and Tutorials     Donor Access     Metamod: Source         Metamod:Source Plugins         Metamod:Source Questions         Coding MM:S Plugins & SM Extensions Hosted Stuff     Asherkin's Plugins         TF2Items         TFDodgeball         SteamTools     Bail's Plugins         CSDM         CS:S DM Off-Topic & Trash     Off-Topic     Trash

All times are GMT -4. The time now is 03:12.

 DMCA - Archive - Top