Raised This Month: $ Target: $400
 0% 

[TF2] Universal Weapon Mode


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 04-01-2009 , 15:35   [TF2] Universal Weapon Mode
Reply With Quote #1

I've been using Instagib in conjunction with sm_givenameditem and having a pretty fun time. I was wondering if someone could combine these two plugins and a remove a few elements and make this new weapon mode.

Essentially, I want to be able to give all players 1 weapon at all times. This weapon is a changeable with a convar like "sm_cvar tf_weapon_rocketlauncher". The weapon's rate of fire would be changeable just like the instagib_rof cvar in the instagib plugin.

Instagib
http://forums.alliedmods.net/showthread.php?t=82879
GiveNamedItem
http://forums.alliedmods.net/showthread.php?t=75822

I've been using givenameditem on arena mode to have everyone play a few matches with the same weapon. Its fun to have a few scouts, demoman, medics and heavies shooting at eachother with rocketlaunchers, but this is only do-able manually using sm_givenameditem @all, and I cant do it on any non arena maps because when people die their weapons get restored back to the original, and I have to regive them the weapons, which disrupts other players' shooting.

In a sad attempt I downloaded Crimson Editor and looked at the scripting for both plugins, thinking I could cut and paste the parts that I wanted, but everything I've done has become botched. =X
MrSaturn is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 04-04-2009 , 12:29   Re: [TF2] Universal Weapon Mode
Reply With Quote #2

Done, although it's not fantastic.

example: sm_equip_weapons "tf_weapon_rocketlauncher, tf_weapon_scattergun"
Attached Files
File Type: txt givenameditem.games.txt (195 Bytes, 203 views)
File Type: sp Get Plugin or Get Source (equip.sp - 545 views - 1.7 KB)
__________________
MikeJS is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 04-05-2009 , 16:02   Re: [TF2] Universal Weapon Mode
Reply With Quote #3

Thnx Alot Mike

I edited it so that the resupply cabinet doesnt work, so people dont regrab their original weapons.

the gamedata file is also a different one that makes it so you dont crash during sudden death.

use plugin from post #5
Attached Files
File Type: sp Get Plugin or Get Source (equip.sp - 453 views - 1.9 KB)
File Type: smx equip.smx (4.2 KB, 200 views)
File Type: txt givenameditem.games.txt (269 Bytes, 230 views)

Last edited by MrSaturn; 04-06-2009 at 12:38.
MrSaturn is offline
NeoDement
Member
Join Date: Mar 2009
Old 04-05-2009 , 22:42   Re: [TF2] Universal Weapon Mode
Reply With Quote #4

Ooh that regeneration fiddling thing is handy, good job

Although you probably should have done it when the plugin started or when a map loaded rather than whenever a player spawns
__________________
I'm not being funny but guys, I'm a bit fit, y'know?
NeoDement is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 04-06-2009 , 12:37   Re: [TF2] Universal Weapon Mode
Reply With Quote #5

Quote:
Originally Posted by NeoDement View Post
Ooh that regeneration fiddling thing is handy, good job

Although you probably should have done it when the plugin started or when a map loaded rather than whenever a player spawns
Ahh, there

I am new to coding so tbh I didnt know what I was doing.

use plugin from post #7
Attached Files
File Type: sp Get Plugin or Get Source (equip.sp - 626 views - 1.9 KB)
File Type: smx equip.smx (4.2 KB, 114 views)
File Type: txt givenameditem.games.txt (269 Bytes, 289 views)

Last edited by MrSaturn; 04-10-2009 at 06:20.
MrSaturn is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 04-06-2009 , 15:24   Re: [TF2] Universal Weapon Mode
Reply With Quote #6

OnPluginStart is only called when the plugin is loaded (OnMapStart is when the map changes). The best time to do this would be when the teamplay_round_start event is fired.
__________________
MikeJS is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 04-10-2009 , 05:26   Re: [TF2] Universal Weapon Mode
Reply With Quote #7

In this new one, the weapons are now rate adjustable. Got the code from http://forums.alliedmods.net/showthread.php?t=88417

sm_cvar sm_rof (-1 to 20)

Things to do :

1. Make the weapons have no reload time, unlimited ammo depending on a cvar
2. Disable resupply properly

I've tried using

Code:
public Action:ev_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
	EnableResupply();
}
public Action:ev_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
	DisableResupply();
}
DisableResupply() {
	new iRegenerate = -1;
	while ((iRegenerate = FindEntityByClassname(iRegenerate, "func_regenerate")) != -1)
		AcceptEntityInput(iRegenerate, "Disable");
}
EnableResupply() {
	new iRegenerate = -1;
	while ((iRegenerate = FindEntityByClassname(iRegenerate, "func_regenerate")) != -1)
		AcceptEntityInput(iRegenerate, "Enable");
}
but no luck. I have no idea how to use teamplay_round_start, Anyways, here it is. using the same gametype datafiles as the previous ones.
Attached Files
File Type: sp Get Plugin or Get Source (equip.sp - 519 views - 3.7 KB)
File Type: smx equip.smx (5.2 KB, 207 views)
MrSaturn is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 04-10-2009 , 05:46   Re: [TF2] Universal Weapon Mode
Reply With Quote #8

You use it just like you use player_spawn. See Events.

Also, a couple of empty lines to seperate calls wouldn't hurt. Your code is barely readable at the moment.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 04-13-2009 , 00:36   Re: [TF2] Universal Weapon Mode
Reply With Quote #9

Where do I put the givenameditem.games.txt
noodleboy347 is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 04-14-2009 , 00:12   Re: [TF2] Universal Weapon Mode
Reply With Quote #10

Quote:
Originally Posted by noodleboy347 View Post
Where do I put the givenameditem.games.txt
gamedata folder.
__________________
pheadxdll 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 01:59.


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