Quote:
Originally Posted by eyal282
|
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_RESERVATION, true))
{
SDKHook(client, SDKHook_GetMaxHealth, SetMaxHealth);
}
}
public Action SetMaxHealth(int entity, int &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.
__________________