Raised This Month: $82 Target: $400
 20% 

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 - 7 views - 18.8 KB)
sastdk is offline
SHIELD755
Senior Member
Join Date: Feb 2018
Location: I am living in house bsd
Old 04-13-2019 , 09:10   Re: Add max health
Reply With Quote #2

Wrong section , its amxmodx
__________________
MY ENGLISH = A0

FB : https://m.facebook.com/lucky.mali.755 (LUCKY GEHLOT)

SENTRY GUN LOVER : CLICK HERE (CHANNEL)
SHIELD755 is online now
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);
__________________
Accepting private work. Contact me if you're interested.
If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.

Total Donated: 10$
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.
__________________
Am I back? Well, we'll see.

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


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