sm_FirstTank_Random_2 = CreateConVar("sm_FirstTank_Random_2", "120.0", "Random time the first tank on a normal map.", FCVAR_NOTIFY);
sm_NextTank_Random_2 = CreateConVar("sm_NextTank_Random_2", "240.0", "A random time the next tank.", FCVAR_NOTIFY);
If it is, you can, put the same time or just delete this part of the code.
sm_FirstTank_Random_2 = CreateConVar("sm_FirstTank_Random_2", "120.0", "Random time the first tank on a normal map.", FCVAR_NOTIFY);
sm_NextTank_Random_2 = CreateConVar("sm_NextTank_Random_2", "240.0", "A random time the next tank.", FCVAR_NOTIFY);
If it is, you can, put the same time or just delete this part of the code.
He probably meant the tanks the Director would spawn.
Ive been using your plugin on my Linux/Windows server, and it's been great to be able to have tanks spawn on chapter one maps for all official and add-on campaigns. I currently use 45 custom maps on my server, but for some unknown reason 15 of my maps wont work with your plugin. The ones that don't work are these:
Carnage
City 17
Quedan 4X Morir[
7 hours later
Bloody Sunday
Death stop
Die trying
Fallen
Heaven can wait
Cape murder
Chaos theory
Night terror
Redemption
Surrounded by the dead
The woods 2
Does your plugin need some extra code to be able to support these above maps? I have found that I can manually force a tank to spawn on these chapter one maps, but I have to use the !admin cheat command "!tank" to do so. So I was wondering if there was some way for your plugin to somehow automatically force these tanks to spawn for these maps using some other kind of cheat command in your plugin.
After further testing of this plugin, I've found that the tanks can only spawn on my dedicated Linux server if the game is hosted from the game lobby. If a player joins an empty server using quick connect from the console ie "connect <IP address>" I found that the tanks wont spawn at all. And the same applies with subsequent maps, even when using an ingame map changing plugin for instance.
public Plugin myinfo =
{
name = "[L4D] Tank Spawn.",
author = "AlexMy",
description = "",
version = "1.5",
url = "https://forums.alliedmods.net/showthread.php?p=2412274"
};
public void OnPluginStart()
{
sm_SpawnTankRoundStartHP = CreateConVar("sm_SpawnTankRoundStartHP", "7000", "The health of the tank on a normal map!", FCVAR_NOTIFY);
sm_FirstTank_Random_1 = CreateConVar("sm_FirstTank_Random_1", "10.0", "Random time the first tank on a normal map.", FCVAR_NOTIFY);
sm_FirstTank_Random_2 = CreateConVar("sm_FirstTank_Random_2", "20.0", "Random time the first tank on a normal map.", FCVAR_NOTIFY);
sm_NextTank_Random_1 = CreateConVar("sm_NextTank_Random_1", "15", "A random time the next tank.", FCVAR_NOTIFY);
sm_NextTank_Random_2 = CreateConVar("sm_NextTank_Random_2", "25", "A random time the next tank.", FCVAR_NOTIFY);
sm_EnableWeapon = CreateConVar("sm_EnableWeapon", "1", "The team will get locked weapons? 0:Off. 1:On.", FCVAR_NOTIFY);
sm_SpawnTankFinaleStartHP = CreateConVar("sm_SpawnTankFinaleStartHP", "7000", "Health tank in the final offensive.", FCVAR_NOTIFY);
In the line of code here: "(IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i)) " something is not being addressed for when a player quick joins a game. So is there something that can be added/updated into the code to address this issue as well?
I guess from my last post (16) there is no viable solution to fixing the tanks not spawning on the above mentioned custom maps either.
I had to hack Alexmy's tank plugin and remove 86 lines of code and make changes/updates where necessary to get it to spawn the tanks on the 15 customs maps I mentioned in my above post 16. But the good news is that all chapter one tanks are now spawning as they should. \o/
However I don't know how to resolve the player 'quick connect' issue from the console (as I'd mentioned in post 17 above). Don't know if anyone here can give advice on what code is needed on how to include a solution for this?
I've also created a new handshake plugin that will work with Red Alex's tank spawn plugin. I use his tank plugin a lot on my server for all other maps, and use Alexmy's for chapter one maps. But what my handshake plugin does is use its own set of timers, that can call upon the cvar values in Red Alex's tank plugin and apply them to Alexmy's tank plugin without using his plugin timer values. With this new handshake set-up, I can load chapter one tanks with Alexmy's plugin, then unload it so that Red Alex's tank plugin can be used for all the other maps. It's a rather complex setup trying to get 3 different plugins to talk to each other like this, but the nice thing is that it's working really well with my server setup.
I'm still working on this handshake script itself - to improve it as well as I can, but what I'll do later is create a new post for this new plugin, and I'll also give credit to Alexmy and Red Alex for giving me the inspiration for creating this new plugin where I can now have tanks spawn the way I want them to on all maps.
Cheers,
Sunyata
Last edited by Sunyata; 11-22-2019 at 11:29.
Reason: fixed typos
Ive been using your plugin on my Linux/Windows server, and it's been great to be able to have tanks spawn on chapter one maps for all official and add-on campaigns. I currently use 45 custom maps on my server, but for some unknown reason 15 of my maps wont work with your plugin. The ones that don't work are these:
Carnage
City 17
Quedan 4X Morir[
7 hours later
Bloody Sunday
Death stop
Die trying
Fallen
Heaven can wait
Cape murder
Chaos theory
Night terror
Redemption
Surrounded by the dead
The woods 2
Does your plugin need some extra code to be able to support these above maps? I have found that I can manually force a tank to spawn on these chapter one maps, but I have to use the !admin cheat command "!tank" to do so. So I was wondering if there was some way for your plugin to somehow automatically force these tanks to spawn for these maps using some other kind of cheat command in your plugin.
Thoughts?
Sunyata
Hi, maybe there are simply no hooks on these company heads for which the plug-in could catch.
Maybe so, but by adding a timer to MapStart and then adding/adjusting your timer-1 code to the MapStart routine, my other handshake plugin then makes a call to your updated MapStart routine to spawn tanks on those 15 custom maps. Maybe it's not the best way to write code, but at least it works for me now, and that's all that matters to me
PHP Code:
public void OnPluginStart() { HookEvent("round_start", Event_RoundTank, EventHookMode_Post); // also adjusted code in Event_RoundTank HookEvent("round_end", Event_RoundEnd, EventHookMode_Post); // also adjusted code Event_RoundEnd
CreateTimer(30.0, MapStart); // new code timer
cleaner(); }
public Action:MapStart(Handle:timer) { CreateTimer(5.0, SpawnTank, TIMER_FLAG_NO_MAPCHANGE); // new modified code timer }
Last edited by Sunyata; 11-23-2019 at 06:00.
Reason: php added