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

[L4D2] I need support with this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jestery
BANNED
Join Date: Aug 2022
Location: Usa
Old 10-12-2023 , 23:30   [L4D2] I need support with this plugin
Reply With Quote #1

I'm using [L4D & L4D2] Self Help - created by panxiaohai

There's a function here allowing players to revive teammates when both are downed, but it ignores the incap count, so basically the one got helped could stand up limitlessly (no B&W state). Can you improve this one so the function could be counted as normal revive, these are the lines:

PHP Code:
HelpOther(clienthelper)
{
    new 
propincapcounter FindSendPropInfo("CTerrorPlayer""m_currentReviveCount");
    new 
count GetEntData(clientpropincapcounter1);

        
count++;
        if(
count>2)count=2;
            
        new 
userflags GetUserFlagBits(client);
        
SetUserFlagBits(clientADMFLAG_ROOT);
        new 
iflags=GetCommandFlags("give");
        
SetCommandFlags("give"iflags & ~FCVAR_CHEAT);
        
FakeClientCommand(client,"give health");
        
SetCommandFlags("give"iflags);
        
SetUserFlagBits(clientuserflags);
            
        
SetEntData(clientpropincapcountercount1);
            
        new 
Handle:revivehealth FindConVar("pain_pills_health_value");  
     
        new 
temphpoffset FindSendPropOffs("CTerrorPlayer","m_healthBuffer");
        
SetEntDataFloat(clienttemphpoffsetGetConVarFloat(revivehealth), true);
        
SetEntityHealth(client1);
         
PrintToChatAll("\x04%N\x03 helped\x04 %N \x03 when incapacitated"helperclient); 
THANK YOU SM ~~~

Last edited by Jestery; 10-12-2023 at 23:30.
Jestery is offline
Send a message via ICQ to Jestery Send a message via AIM to Jestery Send a message via Yahoo to Jestery Send a message via Skype™ to Jestery
moschinovac
Member
Join Date: Mar 2019
Location: Vietnam
Old 10-14-2023 , 09:27   Re: [L4D2] I need support with this plugin
Reply With Quote #2

In the case u use Left4dhooks

PHP Code:
native void L4D_ReviveSurvivor(int client);

HelpOther(clienthelper)
{
    
L4D_ReviveSurvivor(client);
    
PrintToChatAll("\x04%N\x03 helped\x04 %N \x03 when incapacitated"helperclient); 
otherwise, I think this will do the job
PHP Code:
HelpOther(clienthelper)
{
    new 
propincapcounter FindSendPropInfo("CTerrorPlayer""m_currentReviveCount");
    new 
count GetEntData(clientpropincapcounter1);
    new 
MaxIncaps GetConVarInt(FindConVar("survivor_max_incapacitated_count"))

        
count++;
        if(
count>MaxIncaps )count=MaxIncaps;
            
        new 
userflags GetUserFlagBits(client);
        
SetUserFlagBits(clientADMFLAG_ROOT);
        new 
iflags=GetCommandFlags("give");
        
SetCommandFlags("give"iflags & ~FCVAR_CHEAT);
        
FakeClientCommand(client,"give health");
        
SetCommandFlags("give"iflags);
        
SetUserFlagBits(clientuserflags);
            
        
SetEntData(clientpropincapcountercount1);
            
        new 
Handle:revivehealth FindConVar("pain_pills_health_value");  
     
        new 
temphpoffset FindSendPropOffs("CTerrorPlayer","m_healthBuffer");
        
SetEntDataFloat(clienttemphpoffsetGetConVarFloat(revivehealth), true);
        
SetEntityHealth(client1);
         
PrintToChatAll("\x04%N\x03 helped\x04 %N \x03 when incapacitated"helperclient); 
moschinovac is offline
Jestery
BANNED
Join Date: Aug 2022
Location: Usa
Old 10-14-2023 , 21:52   Re: [L4D2] I need support with this plugin
Reply With Quote #3

It worked just fine. Ty moschinovac!
Jestery is offline
Send a message via ICQ to Jestery Send a message via AIM to Jestery Send a message via Yahoo to Jestery Send a message via Skype™ to Jestery
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 04:45.


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