I am looking for a plugin that works as follows:
When the tank spawns, it announces itself in chat by making a sound
Here the sound: sound/ui/pickup_secret01.wav
Here is the announcement of the chat:
[!]The Tank has been spawned!
I can't believe I haven't added this to Mutant Tanks yet. Thanks for the idea!
Quote:
Originally Posted by Marttt
I really don't recommend using Super Tanks, the plugin is old, the author is inactive and has a lot of versions in the thread.
At least the author is active, always nice and helping. Also seem to have the feature you are asking for.
Btw, if you share your SUPER TANKS plugin .sp file I can try to implement it since I don't know which file you are using. (The main post doesn't compile and Ernecio version gives me invalid gamedata)
Thank you for the kind words. I wish there was a way to advertise Mutant Tanks to everyone who still relies on Super Tanks. Even with all the more recent versions of that plugin, most of the code is still outdated. I had to rewrite 90% of the logic in MT because the old code from ST was just causing way too many bugs and random crashes. Unfortunately, that's hard to explain to users who have no knowledge/experience in programming.
Testing in my local server, the previous script work in coop and in versus (with 1 player). When there is more than 1 player (and in different teams) the plugin stops to work in versus after first spawn (weird).
I rewrote the plugin, try this:
Spoiler
PHP Code:
// ====================================================================================================
// Plugin Info - define
// ====================================================================================================
#define PLUGIN_NAME "Tank Spawn Announcement with sound (made to Tank Rush)"
#define PLUGIN_AUTHOR "Mart"
#define PLUGIN_DESCRIPTION "When the tank spawns, it announces itself in chat by making a sound"
#define PLUGIN_VERSION "1.0.2"
#define PLUGIN_URL "https://forums.alliedmods.net/showthread.php?t=330277"
// ====================================================================================================
// Plugin Info
// ====================================================================================================
public Plugin myinfo =
{
name = PLUGIN_NAME,
author = PLUGIN_AUTHOR,
description = PLUGIN_DESCRIPTION,
version = PLUGIN_VERSION,
url = PLUGIN_URL
}
/**
* Validates if is a valid client.
*
* @param client Client index.
* @return True if client index is valid and client is in game, false otherwise.
*/
bool IsValidClient(int client)
{
return (IsValidClientIndex(client) && IsClientInGame(client));
}
/**
* Returns if the client is a valid tank.
*
* @param client Client index.
* @return True if client is a tank, false otherwise.
*/
bool IsPlayerTank(int client)
{
if (!IsValidClient(client))
return false;
if (GetClientTeam(client) != TEAM_INFECTED)
return false;
if (GetZombieClass(client) != g_iTankClass)
return false;
/**
* Returns if any tank is alive.
*
* @return True if any tank is alive, false otherwise.
*/
bool HasAnyTankAlive()
{
for (int client = 1; client <= MaxClients; client++)
{
if (!IsPlayerTank(client))
continue;
There is no translation in this plugin you just need overwrite the "text" part.
I may release it as a plugin. I had hope that in the recent L4D2 updates this issue would have already been solved.
There is no translation in this plugin you just need overwrite the "text" part.
I may release it as a plugin. I had hope that in the recent L4D2 updates this issue would have already been solved.
Hi, when I use multitank and spawn 3 or 4 tanks at the same time, the sound only plays 1 time, how could I fix it so that it sounds 1 time for each Tank?
Testing in my local server, the previous script work in coop and in versus (with 1 player). When there is more than 1 player (and in different teams) the plugin stops to work in versus after first spawn (weird).
I rewrote the plugin, try this:
Spoiler
PHP Code:
// ====================================================================================================
// Plugin Info - define
// ====================================================================================================
#define PLUGIN_NAME "Tank Spawn Announcement with sound (made to Tank Rush)"
#define PLUGIN_AUTHOR "Mart"
#define PLUGIN_DESCRIPTION "When the tank spawns, it announces itself in chat by making a sound"
#define PLUGIN_VERSION "1.0.2"
#define PLUGIN_URL "https://forums.alliedmods.net/showthread.php?t=330277"
// ====================================================================================================
// Plugin Info
// ====================================================================================================
public Plugin myinfo =
{
name = PLUGIN_NAME,
author = PLUGIN_AUTHOR,
description = PLUGIN_DESCRIPTION,
version = PLUGIN_VERSION,
url = PLUGIN_URL
}
/**
* Validates if is a valid client.
*
* @param client Client index.
* @return True if client index is valid and client is in game, false otherwise.
*/
bool IsValidClient(int client)
{
return (IsValidClientIndex(client) && IsClientInGame(client));
}
/**
* Returns if the client is a valid tank.
*
* @param client Client index.
* @return True if client is a tank, false otherwise.
*/
bool IsPlayerTank(int client)
{
if (!IsValidClient(client))
return false;
if (GetClientTeam(client) != TEAM_INFECTED)
return false;
if (GetZombieClass(client) != g_iTankClass)
return false;
/**
* Returns if any tank is alive.
*
* @return True if any tank is alive, false otherwise.
*/
bool HasAnyTankAlive()
{
for (int client = 1; client <= MaxClients; client++)
{
if (!IsPlayerTank(client))
continue;