Raised This Month: $32 Target: $400
 8% 

[L4D2] Additional Medkit for 4+ players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thewintersoldier97
Senior Member
Join Date: Aug 2021
Location: Vietnam
Old 01-27-2022 , 06:51   [L4D2] Additional Medkit for 4+ players
Reply With Quote #1

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!
__________________

Looking for some fun!
thewintersoldier97 is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 01-27-2022 , 07:22   Re: [L4D2] Additional Medkit for 4+ players
Reply With Quote #2

Quote:
Originally Posted by thewintersoldier97 View Post
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"
__________________

Last edited by HarryPotter; 01-27-2022 at 07:27.
HarryPotter is offline
thewintersoldier97
Senior Member
Join Date: Aug 2021
Location: Vietnam
Old 01-27-2022 , 07:55   Re: [L4D2] Additional Medkit for 4+ players
Reply With Quote #3

Quote:
Originally Posted by HarryPotter View Post
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.
__________________

Looking for some fun!

Last edited by thewintersoldier97; 01-27-2022 at 07:55.
thewintersoldier97 is offline
Reply


Thread Tools
Display Modes

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 17:14.


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