Raised This Month: $32 Target: $400
 8% 

[TF2] Spawning entities where a player aims


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 05-19-2017 , 07:33   [TF2] Spawning entities where a player aims
Reply With Quote #1

So I have this bit of code that in my mind should work lol. I'm not sure if I'm using GetClientEyePosition incorrectly or if I need to implement something like TR_TraceRay. I've never experimented with this before /:

HTML Code:
	new ArtillaryExplosion = CreateEntityByName("env_explosion");
		DispatchSpawn(ArtillaryExplosion);
		decl Float:PlayerAim[3];
		//decl Float:PlayerAimAngle[3];
		GetClientEyePosition(Client, PlayerAim);
		//GetClientEyeAngles(Client, PlayerAimAngle);
		TeleportEntity(ArtillaryExplosion, PlayerAim, NULL_VECTOR, NULL_VECTOR);
		DispatchKeyValue(ArtillaryExplosion, "iMagnitude", "100");
		AcceptEntityInput(ArtillaryExplosion, "explode", Client, -1);
Halt is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 05-19-2017 , 08:01   Re: [TF2] Spawning entities where a player aims
Reply With Quote #2

so what is your question?
8guawong is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 05-19-2017 , 08:13   Re: [TF2] Spawning entities where a player aims
Reply With Quote #3

Well this script block doesn't work. its intended to teleport the env_explosion to where the client is looking then explode. But it just explodes at the client.
Halt is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 05-19-2017 , 08:17   Re: [TF2] Spawning entities where a player aims
Reply With Quote #4

Free pasta https://github.com/Pelipoika/TF2_Nex...buster.sp#L390

Also env_explosion in 2017?
https://forums.alliedmods.net/showthread.php?t=272874
__________________

Last edited by Pelipoika; 05-19-2017 at 08:18.
Pelipoika is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 05-19-2017 , 14:24   Re: [TF2] Spawning entities where a player aims
Reply With Quote #5

Quote:
Originally Posted by Pelipoika View Post

So does GetAimPos return a value? Or is that where I would do all my entity stuff, I.E. teleport it, and detonate it.
Halt is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 05-19-2017 , 15:30   Re: [TF2] Spawning entities where a player aims
Reply With Quote #6

https://github.com/Pelipoika/TF2_Nex...ter.sp#L94-L98
8guawong is offline
Reply


Thread Tools
Display Modes

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 16:02.


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