Quote:
Originally Posted by Savier
I want "Have Some Heads" plugin =) pls
|
something like that -_-
PHP Code:
#include <sourcemod>
#include <tf2>
new headsOffset;
public Plugin:myinfo=
{
name = "[TF2] Unnamed",
author = "Leonardo",
description = "N/A",
version = "0.0.0",
url = "N/A",
}
public OnPluginStart()
{
new String:sGameType[16];
GetGameFolderName(sGameType, sizeof(sGameType));
new bool:IsTeamFortress = StrEqual(sGameType, "tf", true);
if(!IsTeamFortress)
SetFailState("This plugin is Team Fortress 2 only.");
headsOffset = FindSendPropInfo("CTFPlayer", "m_iDecapitations");
HookEvent("player_spawn", Event_PlayerSpawn);
}
public Event_PlayerSpawn(Handle:hEvent, String:strName[], bool:bDontBroadcast)
{
new iClient = GetClientOfUserId(GetEventInt(hEvent, "userid"));
if(IsClientInGame(iClient) && IsPlayerAlive(iClient))
if((headsOffset != -1) && (GetEntProp(iClient, Prop_Send, "m_iClass") == 4))
{
SetEntData(iClient, headsOffset, 3);
TF2_AddCondition(iClient, TFCond:TFCond_DemoBuff, -1.0);
}
}
PS: thanks, DarthNinja
__________________