Raised This Month: $ Target: $400
 0% 

[REQ] AMMOMOD Clone for TF2, most already finished.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
casvdry
Member
Join Date: Mar 2008
Old 04-09-2009 , 02:28   [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #1

I've been trying to get AMMOMOD from the original creators for TF2 so that I could host it on a server I had ordered, but the only way they're willing to give it out is if you order their servers (apoplexyservers.com) and the files aren't distributed, you can just use the MOD while you subscribe.

I have been posting about this and someone came along with this post:

Quote:
#44

muscles_marinara
i have something like ammomod that does the same things but doesn't have a countdown or queue or a working airshot counter. i can give it to you and you could edit it to your liking because it took me forever to write it and I still hardly understand sourcepawn
I am willing to donate up to $25 for someone to add in a functional queue system and a countdown. The airshot counter isn't important. If someone here is smart and kind enough to liberate some of us TF2 AMMOMOD freaks from not having access to the original AMMOMOD it would be greatly appreciated.
casvdry is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 04-09-2009 , 03:05   Re: [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #2

Mind explaining WHAT ammomod is? Hard for anyone to help you if we dont even know what your talking about.
__________________
CrimsonGT is offline
casvdry
Member
Join Date: Mar 2008
Old 04-09-2009 , 03:42   Re: [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #3

ARGH! I thought I had posted the server ip for it. I'm an idiot!

It's best explained by just checking it out it stays full almost all day long into the wee hours of the morning:

206.123.125.70:27015

It's basically a DUEL MOD.

Players go against each other 1v1 and it features a system in which you can add yourself to different arenas. The maps for example could exist of a few different arenas. Winner stays, the next in line joins the battle against the winner.

You type commands like !add in chat to add yourself to the different queues.
casvdry is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 04-09-2009 , 05:14   Re: [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #4

Similar to Duel Arena?
__________________
MikeJS is offline
casvdry
Member
Join Date: Mar 2008
Old 04-09-2009 , 06:09   Re: [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #5

Quote:
Originally Posted by MikeJS View Post
Similar to Duel Arena?
Actually, yes. Can you describe the differences between this and AMMOMOD, Pros/Cons of each if possible? Thank you MikeJS

EDIT: I was looking at your ELO rating plugin (Big chess fan here) and was thinking it would be an awesome thing to use with any sort of finished Duel Mod I can find to place on my server. That way, we can see who is some of the top players. I'm not sure if KPD is the best way to decide this for a Duel Mods purpose, maybe it is? I guess better would be to track matches won (Matches being comprised of say 3 rounds) <- don't take this as any sort of request, it's just me brainstorming what I could potentially do with my server ;)

Last edited by casvdry; 04-09-2009 at 06:40.
casvdry is offline
Amigo@Work
Junior Member
Join Date: Feb 2009
Old 04-09-2009 , 08:54   Re: [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #6

Where can I get AMMOMOD?
Amigo@Work is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 04-09-2009 , 08:55   Re: [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #7

You can't. That's why he's requesting a clone.
__________________
MikeJS is offline
Amigo@Work
Junior Member
Join Date: Feb 2009
Old 04-09-2009 , 13:31   Re: [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #8

It's a pity. And exactly no where you can not dig? I looked at some servers, the mod is.
Amigo@Work is offline
noob cannon lol
SourceMod Donor
Join Date: Sep 2005
Old 04-09-2009 , 17:01   Re: [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #9

I've done this awhile ago for thenoid. The ammomod portion of the mod is very easy to re-create since you would only need to decrypt a few scripts, change some values, and then re-encrypt them. The part that you request is considered the "Duel Mod" portion of the mod and can be found here:
http://forums.alliedmods.net/showthread.php?t=80799

However, the code in the last post doesn't work correctly and doesn't include the queuing system that you want. So here is a hopefully working backup of the latest version of the classic Duel Mod with one arena only:
Code:
#include <sourcemod>
#include <sdktools>
#include <tf2>
#include <tf2_stocks>

#define TEAM_SPEC	1
#define TEAM_RED 	2
#define TEAM_BLUE 	3

new Handle:g_hTeamLimit
new Handle:g_hEnableTeamLimit
new Handle:g_hFragLimit
new Handle:g_hEnableQueue
new Handle:g_hHostname

new Handle:TeamTimer[MAXPLAYERS]
new Handle:AdvertiseTimer[MAXPLAYERS]
new Handle:ScoreTimer

new g_Duelers[4]
new Handle:g_ctf
new Handle:g_hQueue
new g_loser
new losetime

public Plugin:myinfo = 
{
	name = "TF2 Duel Tools",
	author = "noobcannonlol",
	description = "For use on duel maps",
	version = "1.0",
	url = "gamesyn.com"
}

public OnPluginStart()
{
	g_hEnableTeamLimit = CreateConVar("mp_enableteamlimit", "1", "1 (on) or 0 (off)")
	g_hTeamLimit = CreateConVar("mp_teamlimit", "1", "Limit teams to this value")
	g_hEnableQueue = CreateConVar("mp_enablequeue", "1", "Enable the dueling queue")
	g_hFragLimit = FindConVar("mp_fraglimit")
	g_hHostname = FindConVar("hostname")
	
	HookEvent("player_team", Event_PlayerTeam, EventHookMode_Pre)
	HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre)
	HookEvent("teamplay_round_start", RoundStartEvent)
	HookEvent("player_hurt", Event_PlayerHurt)
	HookEvent("teamplay_point_captured", Event_PointCapture, EventHookMode_Pre)
	
	g_hQueue = CreateArray(33)
	
	RegConsoleCmd("say", Command_Say)

}

public OnClientDisconnect_Post(client)
{
	RemovePlayerFromQueue(client)
	CreateTimer(1.0, CheckGame)
}

public Action:Command_Say(client, args)
{
	new String:text[192]
	GetCmdArg(1, text, sizeof(text))
	
	new String:arg[8]
	GetCmdArg(2, arg, sizeof(arg))
	
	if (IsQueueOn())
	{
		if (StrEqual(text, "!add"))
		{
			AddPlayerToQueue(client)
			return Plugin_Handled
		}
		else if (StrEqual(text, "!remove"))
		{
			RemovePlayerFromQueue(client)
			return Plugin_Handled
		}
		else if(StrEqual(text, "!queue"))
		{
			PrintQueue()
			return Plugin_Handled
		}
		else if (StrEqual(text, "!duelhelp"))
		{
			ShowHelpPanel(client)
			return Plugin_Handled
		}
	}
	
	return Plugin_Continue

}

public Event_PointCapture(Handle:event, const String:name[], bool:dontBroadcast)
{
	return Plugin_Handled
}

public OnClientPutInServer(client)
{
	new Handle:pack
	AdvertiseTimer[client] = CreateDataTimer(10.0, Advertise, pack)
	WritePackCell(pack, client)
}

public Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
	new userid = GetEventInt(event, "userid")
	new client = GetClientOfUserId(userid)
	
	if (!IsClientInGame(client) || IsFakeClient(client))
		return Plugin_Continue
	
	SetHudTextParams(0.01, 0.8, 5.0, 255, 255, 255, 255)
	ShowHudText(client, 3, "Health: %d", GetClientHealth(client))
	
	new red_dueler = GetDueler(TEAM_RED)
	new blue_dueler = GetDueler(TEAM_BLUE)
	
	if ((red_dueler == 0) || (blue_dueler == 0))
		return Plugin_Continue
	
	new String:red_dueler_name[32]
	new String:blue_dueler_name[32]
	
	GetClientName(red_dueler, red_dueler_name, sizeof(red_dueler_name))
	GetClientName(blue_dueler, blue_dueler_name, sizeof(blue_dueler_name))
	
	for (new i = 1; i <= GetMaxClients(); i++)
	{
		if (IsClientInGame(i) && (GetClientTeam(i) == TEAM_SPEC))
		{
			ShowHudText(i, 3, "%s Health: %d\n%s Health: %d", blue_dueler_name, GetClientHealth(blue_dueler), red_dueler_name, GetClientHealth(red_dueler))
		}
	}
	
	
	
	return Plugin_Continue
}

public RoundStartEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
    g_ctf = CreateEntityByName("game_round_win")
    DispatchSpawn(g_ctf)
}  

public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	new attacker_id = GetEventInt(event, "attacker")
	new attacker = GetClientOfUserId(attacker_id)
	
	new victim_id = GetEventInt(event, "userid")
	new victim = GetClientOfUserId(victim_id)
	
	PrintToChat(victim, "Your killer still has %d health.", GetClientHealth(attacker))
	for (new i = 1; i <= GetMaxClients(); i++)
	{
		if (IsClientInGame(i) && (GetClientTeam(i) > TEAM_SPEC))
		{
			TF2_SetPlayerResourceData(i, TFResource_TotalScore, GetClientFrags(i))
			TF2_SetPlayerResourceData(i, TFResource_Score, GetClientFrags(i))
		}
	}
	
	SetEventBool(event, "dominated", false)
	SetEventBool(event, "revenge", false)
	
	if (GetFragLimit() == 0)
		return Plugin_Continue
	
	CreateTimer(0.1, CheckFrags)
		
	return Plugin_Continue
}

public Event_PlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
	if (!GetConVarBool(g_hEnableTeamLimit))
		return Plugin_Continue
	
	new userId = GetEventInt(event, "userid")
	new oldteam = GetEventInt(event, "oldteam")
	new newteam = GetEventInt(event, "team")
	
	new player = GetClientOfUserId(userId)
	
	if ((newteam == TEAM_RED) || (newteam == TEAM_BLUE))
	{
		if (IsQueueOn() && (g_Duelers[newteam] != player))
		{
			PrintToChat(player, "[Duel Mod] Wait your turn!")
			
			new Handle:pack
			TeamTimer[player] = CreateDataTimer(0.1, ChangeTeam, pack)
			WritePackCell(pack, player)
			WritePackCell(pack, TEAM_SPEC)
			
			return Plugin_Handled
		}
		else if (GetTeamClientCount(newteam) >= GetTeamLimit())
		{
			PrintToChat(player, "[Duel Mod] That team is full!")
			
			new Handle:pack
			TeamTimer[player] = CreateDataTimer(0.1, ChangeTeam, pack)
			WritePackCell(pack, player)
			WritePackCell(pack, TEAM_SPEC)
			
			return Plugin_Handled
		}
		//else if (player == g_loser && (GetGameTime() <= (losetime + 10.0)))
		//{
		//	PrintToChat(g_loser, "[Duel Mod] Losers have to wait 10 seconds before they can join a duel")
		//}
	}
	
	
	return Plugin_Continue
}

public GetTeamFragCount(team)
{
	new fragcount = 0
	for (new i = 1; i <= GetMaxClients(); i++)
	{
		if(IsClientConnected(i) && IsClientInGame(i) && (GetClientTeam(i) == team))
		{
			fragcount += TF2_GetPlayerResourceData(i, TFResource_Score)
		}
			
	}
	return fragcount
}

public GetTeamLimit()
{
	return GetConVarInt(g_hTeamLimit)
}

public GetFragLimit()
{
	return GetConVarInt(g_hFragLimit)
}

public EndRound(winner)
{
	new String:name[32]
	GetTeamName(winner, name, sizeof(name))
	
	SetVariantInt(0)
    AcceptEntityInput(g_ctf, "SetTeam")
	AcceptEntityInput(g_ctf, "RoundWin")
		
	PrintCenterTextAll("First to %d frags is %s! Restarting game...", GetFragLimit(), name)
	ServerCommand("mp_restartgame 10")
	
	new loser
	for(new i = 1; i <= GetMaxClients(); i++)
	{
		if (IsClientInGame(i))
		{
			new team = GetClientTeam(i)
			if ((team != winner) && (team != TEAM_SPEC))
			{
				loser = i
				g_loser = loser
				losetime = GetGameTime()
				new Handle:pack
				TeamTimer[loser] = CreateDataTimer(5.0, ChangeTeam, pack)
				WritePackCell(pack, loser)
				WritePackCell(pack, TEAM_SPEC)
			}
		}
	}
}

public GetDueler(team)
{
	for (new i = 1; i <= GetMaxClients();i++)
	{
		if (IsClientInGame(i) && (GetClientTeam(i) == team))
		{
			return i
		}
	}
	
	return 0
}

public IsQueueOn()
{
	return GetConVarBool(g_hEnableQueue)
}

public PrintQueue()
{
	
	new String:buffer[384]
	StrCat(buffer, sizeof(buffer), "[Duel Mod] Waiting in line: ")
	
	if(GetArraySize(g_hQueue == 0))
	{
		StrCat(buffer, sizeof(buffer), "No one!")
	}
	else
	{
		
	
		for(new i = 0; i < 33; i++)
		{
			new client = GetArrayCell(g_hQueue, i)
			if (IsClientConnected(client))
			{
				new String:name[40]
				GetClientName(client, name, sizeof(name))
				
				TrimString(name)
				StrCat(buffer, sizeof(buffer), name)
				StrCat(buffer, sizeof(buffer), " - ")
			}
		}
	}
	PrintToChatAll(buffer)
}

public PushPlayerQueue(team)
{
	if(GetArraySize(g_hQueue) == 0)
		return
	
	new client = GetArrayCell(g_hQueue, 0)
	if (client)
	{
		g_Duelers[team] = client
		
		ChangeClientTeam(client, team)
		RemovePlayerFromQueue(client)
		
		new String:name[32]
		GetClientName(client, name, sizeof(name))
		TrimString(name)
		PrintToChatAll("[Duel Mod] %s has joined the duel.", name)
		
		TF2_SetPlayerClass(client, TFClass_Soldier)
	}
}

public AddPlayerToQueue(client)
{	
	if(IsPlayerInQueue(client))
	{
		return
	}
	
	PushArrayCell(g_hQueue, client)
	PrintQueue()
	
	CreateTimer(1.0, CheckGame)
}

public RemovePlayerFromQueue(client)
{
	if(IsPlayerInQueue(client))
	{
		RemoveFromArray(g_hQueue, FindValueInArray(g_hQueue, client))
	}
}

public IsPlayerInQueue(client)
{
	if(FindValueInArray(g_hQueue, client) > -1)
	{
		return true
	}
	else
	{
		return false
	}
}
	

public Action:ChangeTeam(Handle:timer, Handle:pack)
{
	new client, team
	ResetPack(pack)
	client = ReadPackCell(pack)
	team = ReadPackCell(pack)
	
	ChangeClientTeam(client, team)
	
	CreateTimer(1.0, CheckGame)
	
	TeamTimer[client] = INVALID_HANDLE
}

public Action:CheckGame(Handle:timer)
{
	//PrintToServer("Checking duel status...")
	if(GetTeamClientCount(TEAM_BLUE) < GetTeamLimit())
	{
		PushPlayerQueue(TEAM_BLUE)
	}
	else if (GetTeamClientCount(TEAM_RED) < GetTeamLimit())
	{
		PushPlayerQueue(TEAM_RED)
	}
}

public Action:CheckFrags(Handle:timer)
{
	if (GetTeamFragCount(TEAM_RED) >= GetFragLimit())
		EndRound(TEAM_RED)			
	
	if (GetTeamFragCount(TEAM_BLUE) >= GetFragLimit())
		EndRound(TEAM_BLUE)
}

public Action:Advertise(Handle:timer, Handle:pack)
{
	new client
	ResetPack(pack)
	client = ReadPackCell(pack)
	PrintToChat(client, "[SM] This server is running Duel Mod by noobcannonlol. Type !help for commands.")

	ShowHelpPanel(client)
}

public ShowHelpPanel(client)
{
	new Handle:panel = CreatePanel()
	DrawPanelItem(panel, "Ammo mod by thenoid", ITEMDRAW_RAWLINE)
	DrawPanelItem(panel, "Duel mod by noobcannonlol", ITEMDRAW_RAWLINE)
	DrawPanelItem(panel, "Play 1v1 duels with a queueing system here", ITEMDRAW_RAWLINE)
	DrawPanelItem(panel, "!add", ITEMDRAW_RAWLINE)
	DrawPanelItem(panel, "!remove", ITEMDRAW_RAWLINE)
	DrawPanelItem(panel, "!queue", ITEMDRAW_RAWLINE)
	DrawPanelItem(panel, "!duelhelp", ITEMDRAW_RAWLINE)
	
	SetPanelKeys(panel, 2^9)
	
	SendPanelToClient(panel, client, NullPanelHandler, 10.0)
	CloseHandle(panel)
}

public NullPanelHandler(Handle:menu, MenuAction:action, param1, param2)
{
}
You can donate money if you appreciate it that much but I don't mind since I don't need any .

EDIT: just noticed a lot of useless and unorganized code in there but whatever

Last edited by noob cannon lol; 04-09-2009 at 17:09.
noob cannon lol is offline
Send a message via AIM to noob cannon lol Send a message via MSN to noob cannon lol
MikeJS
Senior Member
Join Date: Nov 2008
Old 04-10-2009 , 15:12   Re: [REQ] AMMOMOD Clone for TF2, most already finished.
Reply With Quote #10

How would you make multiple queues? I can't think of a great way to do it since Sourcemod doesn't have an eval function like PHP.
An ADT_Array of ADT_Arrays? (or just a normal array if that's not possible)
__________________
MikeJS 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 03:46.


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