Raised This Month: $66 Target: $400
 16% 

TFC - All Teams Are Allies


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   GHW_Chronic (70)
chewweh
Junior Member
Join Date: Dec 2006
Old 12-09-2006 , 19:05   TFC - All Teams Are Allies
Reply With Quote #1

edit update --Version 1.2 (now in zip file with a cfg file too )

Hi.

haven't seen this plugin made before here, but may have been attempted (and never submitted)

reason:
A plugin that makes all teams allies in TFC. This is useful in co-operative maps, skills maps, especially poorly defined maps that have not set up team allies properly.

What it does:
Makes all TFC teams allies n all maps when it runs. I've tested the plugin with concmap_csi (for example as there are 4 teams and it's a skills map), no players can hurt others this way and start DM matches at jump 1 or anywhere.

Usage:
When the plugin runs with amxmodx it basically does its business. Maybe an option to enable/disable the plugin on certain maps would be a new feature in the future someone could add

Credits:
I helped myself to a few searches on this forum only, I had to do several searches and combined code from several other posts, I forgot who most where though Thanks to all posts that helped, one post was by Johnny got his gun so thx.

Source:
.sma code is attached, I hook pfn_spawn, FM_keyvalue and dispatchkeyvalue to do this

notes
Notice bots get confused with this on, so leave bots out of the game with this plugin!!

still to do
fakemeta + engine stuff still together, still need to find a way of using just one.

edit:updated post thx (logged me out when iu was trying to edit)

Quote:
Version 1.2

--------------------------------
Version
-------------------------------

1.2
added log_amx to log plugin status
show mapname in plugin status message
fixed loop if config file not found
shows error message if config file is not found
removed pfn_spawn function
uses watch's method of dispatchkeyvalue in plugin_init

1.1
Added config file for enabling/disabling on maps
the config file contains a map name each line for the plugin to be enabled on

1.0
first release

-----------------------------
Description
-----------------------------

TFC AMXX Plugin

Makes all teams allies
For co-operative servers/maps

------------------------------
install
----------------------------

put .amxx file into addons/amxmodx/plugins/
put .cfg file into addons/amxmodx/config

edit addons/amxmodx/config/plugins.ini
add allteamally.amxx

edit allteamally.cfg to add map names you want the plugin to be enabled on with

-------------------------
Running
--------------------------
The plugin runs automatically making ALL teams allies, it will run
only on maps that are listed in allteamally.cfg


--------------------------------
Author
---------------------------------

chewweh/[Rcbot]cheeseh

cheeseh(at)bots-united(dot)com

--------------------
Credits
--------------------

-Johnny got his gun (amx mod post on keyvalue)
-Watch (amxmodx forums)

Can't remember all, those that posted on forums.alliedmods.net and posted relevant stuff for me to search!!!

PS

This is my first plugin for AMXmodX but its not badly written, I know how to code hehe. I would have done it for metamod instead but the porting issues made me chose amxx.


example allteamally.cfg (addons/amxmodx/configs/)

Quote:
concmap_csi
conc_speed
concmap_mm
Plugin Attached + Some Screens of plugin in use
Attached Thumbnails
Click image for larger version

Name:	concmap_csi0000.jpg
Views:	897
Size:	68.9 KB
ID:	12384   Click image for larger version

Name:	concmap_csi0002.jpg
Views:	780
Size:	86.5 KB
ID:	12386  
Attached Files
File Type: zip allteamally.zip (5.3 KB, 233 views)
File Type: sma Get Plugin or Get Source (allteamally.sma - 1127 views - 3.9 KB)

Last edited by chewweh; 12-21-2006 at 13:57.
chewweh is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 12-09-2006 , 19:28   Re: TFC - All Teams Are Allies
Reply With Quote #2

you only have a sma and a amxx file . Dont put them in a zip folder. Only extra files like sounds or models go into a zip file . The moderators wont even want to look at this becasue they have to downlaod and unzip the whole thing. Just post the sma file it will auto compile.
The Specialist is offline
Send a message via AIM to The Specialist
chewweh
Junior Member
Join Date: Dec 2006
Old 12-09-2006 , 19:33   Re: TFC - All Teams Are Allies
Reply With Quote #3

Thanks, new to the forums, never knew they could be auto compiled! I was wondering where the 'Get Plugin' came from :p I (I had a readme.txt so i thought i would put it in the zip ;)) Thanks again.

Last edited by chewweh; 12-09-2006 at 20:04.
chewweh is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 12-10-2006 , 22:13   Re: TFC - All Teams Are Allies
Reply With Quote #4

why is there a GPL attached?
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Old 12-10-2006, 22:18
chewweh
This message has been deleted by chewweh. Reason: removed
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 12-10-2006 , 22:31   Re: TFC - All Teams Are Allies
Reply With Quote #5

The GPL is posted on the AMXX site and thus anything posted unto the AMXX site has the GPL with it. The GPL file that you uploaded will confuse users in thinking that it is a multi-lingual text file required for the plugin.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Lt Llama
Senior Member
Join Date: Aug 2004
Old 12-11-2006 , 03:33   Re: TFC - All Teams Are Allies
Reply With Quote #6

Good job on your first plugin.
__________________
A dodo: Used to describe someone without common sense and who always has the pathetic confused look on their face when a question is asked.
Lt Llama is offline
watch
Senior Member
Join Date: Sep 2005
Old 12-11-2006 , 08:33   Re: TFC - All Teams Are Allies
Reply With Quote #7

Quote:
but may have been attempted (and never submitted)
^^

You could improve it by removing the need for the engine module D:
__________________
Code:
#include <amusing_small_signiture>

Last edited by watch; 12-11-2006 at 08:45.
watch is offline
chewweh
Junior Member
Join Date: Dec 2006
Old 12-11-2006 , 10:53   Re: TFC - All Teams Are Allies
Reply With Quote #8

Thanks Yeah I removed the gpl text link for confusion, thought it was required. I don't know if it will work without the engine too because it requires hooking pfn_spawn (engine function) and also requires fakemeta (keyvalue) also needs DispatchKeyValue, so I don't know if there is a work around for it!
chewweh is offline
watch
Senior Member
Join Date: Sep 2005
Old 12-11-2006 , 11:53   Re: TFC - All Teams Are Allies
Reply With Quote #9

You can do it just in fakemeta look up the keyvalue stock in VEN's Fakemeta Utils inc in the tutorials section.

But info_tfdetect can actually be changed midgame, it doesn't have to be on precache. A better way would be to just find the entity on init and then make the changes to the keyvalues.

Also my knowledge of bitfields isnt great so i doubt it makes any difference but when mapping i've always been specific with it like:
team1_allies 14, team2_allies 13, team3_allies 11, team4_allies 7.

Try this... Can't compile/test it myself D: Had to quickly put it together in word because they have sodding restricted notepad on this pc

Code:
#include <amxmodx>
#include <engine>

#define PLUGIN "All Team Allies"
#define AUTHOR "chewweh"
#define VERSION "1.0"
 
public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)       

	register_cvar("tfc_fixteams", "1")

	if (!get_cvar_num("tfc_fixteams"))
		return PLUGIN_CONTINUE

	new ent = find_ent_by_class(-1, "info_tfdetect")
	if (ent)
	{
DispatchKeyValue(ent, "team1_allies", "14")
DispatchKeyValue(ent, "team2_allies", "13")
DispatchKeyValue(ent, "team3_allies", "11")
DispatchKeyValue(ent, "team4_allies", "7")
	}
// you could create the ent if it doesn’t exist, although all maps will have one otherwise TFC crashes when you select anything other than the blue team.

return PLUGIN_CONTINUE 
}
__________________
Code:
#include <amusing_small_signiture>

Last edited by watch; 12-11-2006 at 12:05.
watch is offline
chewweh
Junior Member
Join Date: Dec 2006
Old 12-11-2006 , 12:29   Re: TFC - All Teams Are Allies
Reply With Quote #10

Hmm, although doesnt DispatchKeyValue have to be called before the entity is spawned?

I'm not sure if entities can be search for before they are spawned. I don't know if plugin_init is called before or after all entities are spawned either!.

I'll have to try it out and tell you if it works or not

edit: oh well! it seems to work! The bots still get confused though (no big deal though!!) it works without having to call dispatchSpawn() Either!

would you mind if I added the changes [with appropriate credit of course]?

Last edited by chewweh; 12-11-2006 at 12:38.
chewweh 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 21:25.


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