View Single Post
Author Message
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 02-24-2011 , 09:10   [ANY] Ion Cannon Weapon (Version 1.2.1 Updated 03.05.2011)
Reply With Quote #1

Ion Cannon Weapon in Source

This is a port of hjkwe645 aka A.F.'s AMX Mod X weaponmod ion cannon weapon as requested here.

Credits for the math and sounds entirely to him - nice work!

Description:
Players are able to buy ion cannons, charging $10000 by default, by typing !buyion in chat. Now when using the knife outside, you're able to place an ion cannon at your position. Give the satellite time to locate you and see a big laser bashing from the sky destroying anything around.

This should work in any game - I only tested in CS:S though.

If you want to place the ion cannon with a different weapon than the knife change the
sm_ion_weapon convar to your weapon.

L4D(2):
Remove the "//" in front of the following line and recompile to use default HL2 sounds instead of the offered sounds, so the clients don't need to download anything.
PHP Code:
//#define ALTERNATIVE_SOUNDS 


Video:

Some more effects have been added since the version in the video.
http://www.youtube.com/watch?v=c52AUZYFYFk
http://www.youtube.com/watch?v=FBJbHuzfWOY&hd=1

ConVars:
  • sm_ion_version - ...
  • sm_ion_defaultammo - How many ion cannons should a player get by default on join? (Default: 1)
  • sm_ion_maxammo - How many ion cannons should a player be able to "carry" at a time? (Default: 5)
  • sm_ion_buy_enable - Are players allowed to buy an ion cannon via "!buyion"? (Default: 1)
  • sm_ion_buy_price - How much money does the ion cannon cost? (Default: $10000)
  • sm_ion_deploytime - How long does it take to display the beams after deploying a ion cannon in seconds? (Default: 30)
  • sm_ion_shaketime - How long should the client's screen shake after explosion in seconds? (Default: 10)
  • sm_ion_radius - The radius of the explosion. (Default: 2000)
  • sm_ion_mindamage - How much damage does the explosion deal at min? (Default: 42100)
  • sm_ion_maxdamage - How much damage does the explosion deal at max? (Default: 54200)
  • sm_ion_weapon - Which weapon should be used to deploy ion cannons? (Default: weapon_knife)
  • sm_ion_glowsprites - How many glow sprites should be spit out on explosion? (Note: They are shot twice with different velocity!) (Default: 300)
  • sm_ion_placetime - How many seconds should player have to stand still to deploy an ion cannon? (Default: 5)
Admin Command:
There is only 1 command for admins with the root "z" flag:
sm_giveion <#userid|steamid|name> - Give a player an ion cannon.

This command ignores the sm_ion_maxammo setting.

If you set sm_ion_buy_enable 0 and sm_ion_defaultammo 0 in your config file. Only admins with the root flag are able to use the ion cannon.

Compile Requirements:
This plugin uses berni's and Chanz' smlib and exvel's colors library.
Download both and put inside your include folder, if you want to compile yourself.

Credits:
  • hjkwe645 aka A.F.: Original idea and math
  • V0gelz: I used his smoke and env_shooter code from his Fireworks plugin
Changelog:
Quote:
  • 1.0: Initial release
  • 1.1: Added alternative hl2 only sounds and admin command to give ion cannons
  • 1.2: Added own cvar for weapon, fixed fire, added cvar for glowing sprite amount, fixed showing progress bar on games that don't support it
  • 1.2.1: Fixed using m_iAccount even if sm_ion_buy_price is set to 0, Added blue glow to where ion cannon has been deployed
Versions:
For easy use, there are 2 compiled versions attached.
  • ioncannon.smx - Uses the sounds in ioncannon_sounds.zip. Players have to download them on join.
  • ioncannon_alt.smx - Uses alternative hl2 sounds all clients already have. Use this for L4D(2).
Attached Files
File Type: zip ioncannon_sounds.zip (2.05 MB, 2416 views)
File Type: sp Get Plugin or Get Source (ioncannon.sp - 2174 views - 42.8 KB)
File Type: smx ioncannon.smx (29.6 KB, 1790 views)
File Type: smx ioncannon_alt.smx (30.4 KB, 1561 views)
__________________

Last edited by Peace-Maker; 05-03-2011 at 14:56. Reason: Updated to 1.2.1
Peace-Maker is offline