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

Add max health


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sastdk
Junior Member
Join Date: Apr 2019
Old 04-13-2019 , 09:08   Add max health
Reply With Quote #1

Hello guys, i know is a probably stupid question, but can you tell me how i can set a maximum health for a vip?
I am a begginer and I kinda wanna to learn, thanks.
Attached Files
File Type: sp Get Plugin or Get Source (hexvips.sp - 71 views - 18.8 KB)
sastdk is offline
SHIELD755
Veteran Member
Join Date: Feb 2018
Location: FROM MARVEL STUDIO
Old 04-13-2019 , 09:10   Re: Add max health
Reply With Quote #2

Wrong section , its amxmodx
__________________
SED LYF !!!
SHIELD755 is offline
sastdk
Junior Member
Join Date: Apr 2019
Old 04-13-2019 , 09:13   Re: Add max health
Reply With Quote #3

sorry
sastdk is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 04-13-2019 , 15:13   Re: Add max health
Reply With Quote #4

Check my plugin when I set the VIP's max health, CS:GO but should work for all games.

https://forums.alliedmods.net/showth...47#post2644547

If I recall correctly:

SetEntProp(client, Prop_Send, "m_iMaxHealth", 500);
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-13-2019 , 16:56   Re: Add max health
Reply With Quote #5

Quote:
Originally Posted by eyal282 View Post
Check my plugin when I set the VIP's max health, CS:GO but should work for all games.

https://forums.alliedmods.net/showth...47#post2644547

If I recall correctly:

SetEntProp(client, Prop_Send, "m_iMaxHealth", 500);
Actually, it doesn't work for all games. Not sure about L4D1/2, but it definitely doesn't work in TF2.

SDKHooks has a callback that works on all Valve games, though: SDKHook_GetMaxHealth

I haven't used it, but it should look something like this:

PHP Code:
// At the top of the plugin
#include <sdkhooks>

// Elsewhere in the plugin
public void OnClientPostAdminCheck(int client)
{
    
// Replace ADMFLAG_RESERVATION with whatever access level your VIPs have
    // or use the "vip" override
    
if (CheckCommandAccess(client"vip"ADMFLAG_RESERVATIONtrue))
    {
        
SDKHook(clientSDKHook_GetMaxHealthSetMaxHealth);
    }
}

public 
Action SetMaxHealth(int entityint &maxhealth)
{
    
// We already checked if they're a VIP before hooking them
    
maxhealth 500;
    return 
Plugin_Changed;

Edit: If you expect VIP status to change during a game, you can just hook all players in OnClientPutInGame and move the VIP check to the callback.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-13-2019 at 16:58.
Powerlord 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 02:08.


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