AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [L4D2] Additional Medkit for 4+ players (https://forums.alliedmods.net/showthread.php?t=336095)

thewintersoldier97 01-27-2022 06:51

[L4D2] Additional Medkit for 4+ players
 
Hello, can someone create a plugin that check and spawn additional medkit for extra players on safe room or before the holdout/scavenge finales event start like the feature on Shao's Superversus 2.5 or link me to a plugin that still working with similar feature?
Any help is greatly appreciated!

HarryPotter 01-27-2022 07:22

Re: [L4D2] Additional Medkit for 4+ players
 
Quote:

Originally Posted by thewintersoldier97 (Post 2769552)
Hello, can someone create a plugin that check and spawn additional medkit for extra players on safe room or before the holdout/scavenge finales event start like the feature on Shao's Superversus 2.5 or link me to a plugin that still working with similar feature?
Any help is greatly appreciated!

You can copy the code from his post,

PHP Code:


public void OnPluginStart()
{
    
HookEvent("finale_start"Event_FinaleStartEventHookMode_Post);
}

// ------------------------------------------------------------------------
//  Spawn extra medkits at the finale based on survivors on the team after the finale starts.
// ------------------------------------------------------------------------
public void Event_FinaleStart(Event event, const char[] namebool dontBroadcast)
{
    if(
FinaleExtraFirstAid.BoolValue)
    {
        
int client GetAnyAliveSurvivor();
        
int amount GetSurvivorTeam() - 4;

        if(
amount && client 0)
        {
            for(
int i 1<= amounti++)
            {
            
CheatCommand(client"give""first_aid_kit""");
            }
        }
    }
}

void CheatCommand(int client, const char[] command, const char[] argument1, const char[] argument2)
{
    
int userFlags GetUserFlagBits(client);
    
SetUserFlagBits(clientADMFLAG_ROOT);
    
int flags GetCommandFlags(command);
    
SetCommandFlags(commandflags & ~FCVAR_CHEAT);
    
FakeClientCommand(client"%s %s %s"commandargument1argument2);
    
SetCommandFlags(commandflags);
    
SetUserFlagBits(clientuserFlags);


search string "first_aid_kit"

thewintersoldier97 01-27-2022 07:55

Re: [L4D2] Additional Medkit for 4+ players
 
Quote:

Originally Posted by HarryPotter (Post 2769557)
Spoiler

Hi Harry, thanks for replying. Unfortunately I'm clueless when it come to scripting and coding an actual plugin.
I've tried comment out all the elements I don't need from one of his fork here but it produce tons of errors and warning when compiling, and every attempt to fix one warning another one pops up.


All times are GMT -4. The time now is 04:53.

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