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[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if (IsClientInGame(client) && IsPlayerAlive(client))
{
if (GetClientTeam(client) == 2)
SetEntityHealth(client, 100);
else
SetEntityHealth(client, 999);
}
}
__________________