View Single Post
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 08-18-2010 , 03:13   Re: [TF2] Have Some Ballz!
Reply With Quote #6

Quote:
Originally Posted by Savier View Post
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(sGameTypesizeof(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:hEventString:strName[], bool:bDontBroadcast)
{
    new 
iClient GetClientOfUserId(GetEventInt(hEvent"userid"));
    if(
IsClientInGame(iClient) && IsPlayerAlive(iClient))
        if((
headsOffset != -1) && (GetEntProp(iClientProp_Send"m_iClass") == 4))
        {
            
SetEntData(iClientheadsOffset3);
            
TF2_AddCondition(iClientTFCond:TFCond_DemoBuff, -1.0);
        }

PS: thanks, DarthNinja
__________________

Last edited by Leonardo; 08-18-2010 at 03:26.
Leonardo is offline