Raised This Month: $ Target: $400
 0% 

Spawn a rocket on button press


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
walabulu4
Junior Member
Join Date: Sep 2019
Old 10-04-2019 , 11:52   Re: Spawn a rocket on button press
Reply With Quote #1

Quote:
Originally Posted by nosoop View Post
Is this for TF2? Since it looks like you're up for learning how to do it, here's some steps you can follow:
  1. Add a command listener to the "voicemenu" command and detect the "MEDIC!" call. You can use this snippet (ported to new syntax, ideally). Make sure it works by displaying some messages with PrintToChat or PrintToServer before moving on.
  2. Determine the position to spawn your rocket (likely with GetClientEyePosition and GetClientEyeAngles), then spawn your rocket. This snippet should be fine, though it's also in old syntax.
  3. Set up a cooldown. Create a float array for your players (size MAXPLAYERS + 1), then when you need to update your cooldown, set it to GetGameTime() + your_cooldown_amount. You can check if the cooldown has passed if GetGameTime() is larger than the array entry. Don't forget to zero out the time in an OnClientPutInServer() forward.

Thank you! I shall give this a shot. I am a little unsure of new syntax vs old, but im sure some trial and error will solve that
walabulu4 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 21:20.


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