Thread: [Solved] How force health to 100
View Single Post
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 10-05-2018 , 02:38   Re: How force health to 100
Reply With Quote #4

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
void Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
    if (
IsClientInGame(client) && IsPlayerAlive(client))
    {
        if (
GetClientTeam(client) == 2)
            
SetEntityHealth(client100);
        else
            
SetEntityHealth(client999);
    }

__________________
8guawong is offline