Raised This Month: $51 Target: $400
 12% 

[L4D & L4D2] Tank Pass v2.5 [02 Sep 2020]


Post New Thread Reply   
 
Thread Tools Display Modes
disawar1
AlliedModders Donor
Join Date: Aug 2011
Location: Russian
Old 08-06-2020 , 13:37   Re: [L4D & L4D2] Tank Pass v2.2 [01 Aug 2020]
Reply With Quote #11

Unfortunately I do not accept any requests (too busy). I'm just going to share old stuff only.
__________________
disawar1 is offline
disawar1
AlliedModders Donor
Join Date: Aug 2011
Location: Russian
Old 09-02-2020 , 05:56   Re: [L4D & L4D2] Tank Pass v2.5 [02 Sep 2020]
Reply With Quote #12

Here the huge update from v2.3 to v2.5. Finale bug were fixed. Enjoy
__________________
disawar1 is offline
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 02-05-2021 , 07:47   Re: [L4D & L4D2] Tank Pass v2.5 [02 Sep 2020]
Reply With Quote #13

Here I made some modification, with native support, let other plugins use Tank Pass!

Fix Server with points_system plugins and more 4 infected player:
When 5th...nth player bought a tank, server spawn with wrong player, Tank Pass plugins transfer Tank to bought player

Native:
PHP Code:
/**
 * Change player Tank to another target player
 *
 * @param num1    target tank player.
 * @param num2    target client to play as tank.
 */
native void TS_TankPass(int iClientOldint iClientNew); 
points system need to modified:
PHP Code:
#include <l4d_tank_pass>
...
bool ClientBoughtTank[MAXPLAYERS] = { false, ... };
...
void hookGameEvents()
{
    ...
    
HookEvent("player_spawn"Event_Spawn); //new
    
return;
}
...
public 
Action Event_Spawn(Handle hEvent, const char[] sEventNamebool bDontBroadcast)
{
    
int client GetClientOfUserId(GetEventInt(hEvent"userid"));

    if (
client == 0)
        return;

    if (
IsFakeClient(client))
        return;

    if (
GetEntProp(clientProp_Send"m_zombieClass") == 8// TANK
    
{
        if (
ClientBoughtTank[client])
        {
            
ClientBoughtTank[client] = false// state reset before swap happen, prevent double trigger
            
PrintToChat(client"\x04[Lewd4Dead] \x01You bought the \x05TANK\x01! Crush them!");
        }
        else
        {
            for (
int i 1<= MaxClientsi++)
            {
                if (
ClientBoughtTank[i])
                {
                    
ClientBoughtTank[i] = false// state reset before swap happen, prevent double trigger

                    
if (GetEntProp(iProp_Send"m_zombieClass") == 8// block player already tank, give to other player
                    
{
                        
PrintToChatAll("\x04[Lewd4Dead] \x05%N \x01bought a \x03Tank \x01and server give it to \x05%N"iclient);
                        return;
                    }

                    
PrintToChat(client"\x04[Lewd4Dead] \x01Transfering this Tank to \x05%N"i);
                    
PrintToChat(i"\x04[Lewd4Dead] \x01You received a Tank from \x05%N"client);

                    
TS_TankPass(clienti);

                    break;
                }
            }
        }
    }
    return;
}
...
public 
MenuHandler_ConfirmI(Handle:menuMenuAction:actionparam1param2)
{
    switch(
action)
    {
        case 
MenuAction_End:
        {
            
CloseHandle(menu);
        }
        case 
MenuAction_Cancel:
        {
            
strcopy(PlayerData[param1][sItemName], 64PlayerData[param1][sBought]);
            
PlayerData[param1][iItemCost] = PlayerData[param1][iBoughtCost];
        }
        case 
MenuAction_Select:
        {
            
decl String:choice[40];
            
GetMenuItem(menuparam2choicesizeof(choice));
            if (
StrEqual(choice"no"false))
            {
                
BuildBuyMenu(param1);
                
strcopy(PlayerData[param1][sItemName], 64PlayerData[param1][sBought]);
                
PlayerData[param1][iItemCost] = PlayerData[param1][iBoughtCost];
            }
            else if (
StrEqual(choice"yes"false))
            {
                if (!
HasEnoughPoints(param1PlayerData[param1][iItemCost]))
                    return;
                    
                if (!
IsPlayerAlive(param1))
                {
                    
PrintToChat(param1,  "\x04[Lewd4Dead] \x01You need in \x03Spawn Ready \x01before can make a purchase.");
                    return;
                }

                if (
StrEqual(PlayerData[param1][sItemName], "suicide"false))
                {
                    
performSuicide(param1PlayerData[param1][iItemCost]);
                    return;
                }
                else if (
StrEqual(PlayerData[param1][sItemName], "z_spawn mob"false))
                {
                    
CounterData[iUCommonLeft] += GetConVarInt(FindConVar("z_common_limit"));
                }
                else if (
StrEqual(PlayerData[param1][sItemName], "z_spawn tank auto"false))
                {
                    if (
CounterData[iTanksSpawned] == GetConVarInt(PluginSettings[hTankLimit]))
                    {
                        
PrintToChat(param1,  "%T""Tank Limit"LANG_SERVER);
                        return;
                    }

                    
ClientBoughtTank[param1] = true// tag player bought a tank
                    
CounterData[iTanksSpawned]++;
                }
                else if (
StrEqual(PlayerData[param1][sItemName], "z_spawn witch auto"false) || StrEqual(PlayerData[param1][sItemName], "z_spawn witch_bride auto"false))
                {
                    if (
CounterData[iWitchesSpawned] == GetConVarInt(PluginSettings[hWitchLimit]))
                    {
                        
PrintToChat(param1,  "%T""Witch Limit"LANG_SERVER);
                        return;
                    }
                    
CounterData[iWitchesSpawned]++;
                }
                else if (
StrContains(PlayerData[param1][sItemName], "z_spawn"false) != -&& StrContains(PlayerData[param1][sItemName], "mob"false) == -1)
                {
                    if (
IsPlayerAlive(param1) || IsPlayerGhost(param1))
                    {
                        return;
                    }
                    new 
bool:resetGhost[MaxClients+1], bool:resetAlive[MaxClients+1], bool:resetLifeState[MaxClients+1];
                    for (new 
i=1;i<=MaxClients;i++)
                    {
                        if (
== param1 || !IsClientInGame(i) || GetClientTeam(i) != || IsFakeClient(i))
                        {
                            continue;
                        }

                        if (
IsPlayerGhost(i))
                        {
                            
resetGhost[i] = true;
                            
resetAlive[i] = true;
                            
SetPlayerGhost(ifalse);
                            
SetPlayerAlive(itrue);
                        }
                        else if (!
IsPlayerAlive(i))
                        {
                            
resetLifeState[i] = true;
                            
SetPlayerLifeState(ifalse);
                        }
                    }

                    
execClientCommand(param1PlayerData[param1][sItemName]);

                    new 
maxretry GetConVarInt(PluginSettings[hSpawnAttempts]);
                    for (new 
i;i<maxretry;i++)
                    {
                        if (!
IsPlayerAlive(param1))
                        {
                            
execClientCommand(param1PlayerData[param1][sItemName]);
                        }
                    }

                    if (
IsPlayerAlive(param1))
                    {
                        
strcopy(PlayerData[param1][sBought], 64PlayerData[param1][sItemName]);
                        
PlayerData[param1][iBoughtCost] = PlayerData[param1][iItemCost];
                        
removePoints(param1PlayerData[param1][iItemCost]);
                    }
                    else
                    {
                        
PrintToChat(param1"%s %T"MSGTAG"Spawn Failed"param1);
                    }


                    for (new 
i=1;i<=MaxClients;i++)
                    {
                        if (
resetGhost[i]) SetPlayerGhost(itrue);
                        if (
resetAlive[i]) SetPlayerAlive(ifalse);
                        if (
resetLifeState[i]) SetPlayerLifeState(itrue);
                    }
                    return;
                }
                
strcopy(PlayerData[param1][sBought], 64PlayerData[param1][sItemName]);
                
PlayerData[param1][iBoughtCost] = PlayerData[param1][iItemCost];
                
removePoints(param1PlayerData[param1][iItemCost]);
                
execClientCommand(param1PlayerData[param1][sItemName]);
            }
        }
    }

Attached Files
File Type: sp Get Plugin or Get Source (l4d_tank_pass.sp - 198 views - 24.2 KB)
File Type: inc l4d_tank_pass.inc (330 Bytes, 197 views)
__________________

Last edited by ilham92-cc-sakura; 02-05-2021 at 07:48.
ilham92-cc-sakura is offline
in2002
Member
Join Date: Apr 2021
Location: Taiwan
Old 07-02-2021 , 23:44   Re: [L4D & L4D2] Tank Pass v2.5 [02 Sep 2020]
Reply With Quote #14

l4d_lib.inc can not download
in2002 is offline
Sempiro
Member
Join Date: Apr 2014
Old 10-01-2021 , 03:21   Re: [L4D & L4D2] Tank Pass v2.5 [02 Sep 2020]
Reply With Quote #15

// Admin Commands (ADMFLAG_KICK):
sm_forcepass <#userid|name> // Force to pass the Tank to target player.
sm_taketank <#userid|name> // Take control of the Tank AI.

1. Is it possible to make the plugin act just like it is with "Tank Swap" plugin (https://forums.alliedmods.net/showthread.php?t=120807) without the hustle of adding "#userid|name" to the command? With "Tank Swap", if you are an admin, just "sm_taketank" is enough.

2. Would it be possible to explain formatting for "#userid|name"? "userid" here is Steam ID and "name" is current Steam name?

3. What are the differences between "sm_forcepass" and "sm_taketank"?

Thank you

Last edited by Sempiro; 10-01-2021 at 03:39.
Sempiro is offline
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 11-11-2021 , 18:39   Re: [L4D & L4D2] Tank Pass v2.5 [02 Sep 2020]
Reply With Quote #16

This plugin is very good, I use TankHUD on my server, but it interferes with your Tank Pass menu.
Just watch this video and you will understand what I mean.
Is there a way to make the Tank Pass menu open before the tank appears like in this other video?
Please, I need it

Quote:
Originally Posted by in2002 View Post
l4d_lib.inc can not download
Here you go bro
Attached Files
File Type: inc l4d_lib.inc (16.3 KB, 165 views)
__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382
Tank Rush is offline
SilentBr
Veteran Member
Join Date: Jan 2009
Old 12-19-2021 , 14:10   Re: [L4D & L4D2] Tank Pass
Reply With Quote #17

Quote:
Originally Posted by disawar1 View Post
Bug were fixed in v2.2. Read notes.
I'm going to release the Tank vote plugin next week. I need to update the syntax and do other work.
Hey mate, did you release the tank vote plugin? I could not find it.
thanks
SilentBr is offline
laurauwu
Member
Join Date: Feb 2022
Location: Curitiba / PR - Brazil
Old 03-06-2022 , 11:42   Re: [L4D & L4D2] Tank Pass v2.5 [02 Sep 2020]
Reply With Quote #18

Bug report
Help??

if you use !pass and have 2 tanks one of the tanks disappears
laurauwu is offline
CosmicD
Senior Member
Join Date: Dec 2009
Location: Hasselt, Belgium
Old 03-28-2022 , 08:54   Re: [L4D & L4D2] Tank Pass v2.5 [02 Sep 2020]
Reply With Quote #19

plugin does not function at consistently on my server, either I can't pass a tank to a certain player (message: you cannot pass the tank to this player), and when the admin does a forcepass command and he wants to pass the tank to me, plugin doesn't give admin a message, nor do I get a confirmation dialog to receive the tank. (using sm 1.10 latest stable)

edit: sorry, it wasn't entirely clear that it also needed a phrases file in translations. shouldn't it be put with the required files ?
__________________

Last edited by CosmicD; 03-28-2022 at 10:40.
CosmicD is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 08-28-2022 , 00:50   Re: [L4D & L4D2] Tank Pass v2.5 [02 Sep 2020]
Reply With Quote #20

it conflicts with tankhud

Last edited by JLmelenchon; 08-28-2022 at 04:47.
JLmelenchon 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 00:30.


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