Raised This Month: $51 Target: $400
 12% 

Chicken point! CSGO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 07-14-2015 , 14:40   Chicken point! CSGO
Reply With Quote #1

Hi, i want to know how to spawn chickens and give points for the player that killed the chicken !
All that i know is to spawn the chickens haha !
Dkmuniz is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 07-14-2015 , 17:54   Re: Chicken point! CSGO
Reply With Quote #2

Someone ?
Dkmuniz is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 07-14-2015 , 18:12   Re: Chicken point! CSGO
Reply With Quote #3

Use a TakeDamage hook perhaps

Last edited by Miu; 07-14-2015 at 18:14.
Miu is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 07-14-2015 , 19:06   Re: Chicken point! CSGO
Reply With Quote #4

Quote:
Originally Posted by Miu View Post
Use a TakeDamage hook perhaps
But i know that i'm killing a chicken ?
Dkmuniz is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 07-14-2015 , 19:10   Re: Chicken point! CSGO
Reply With Quote #5

Unless you're creating them with unusually high health, any damage from a player will kill them, if I recall correctly
Miu is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 07-15-2015 , 00:26   Re: Chicken point! CSGO
Reply With Quote #6

I make this but dont add player point!
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

new g_iPontos[MAXPLAYERS+1];

public 
Pluginmyinfo =
{
    
name "Points Chicken",
    
author "Dk--",
    
description "Get points for kill a chicken",
    
version "teste",
    
url ""
};

new 
HandleCVAR_SOUND INVALID_HANDLE;


new 
StringEXPLODE_SOUND[PLATFORM_MAX_PATH];

public 
OnPluginStart()
{
    
CVAR_SOUND CreateConVar("sm_sound_chicken""darky/mario_powerup.mp3""");
    
    
HookConVarChange(CVAR_SOUNDOnSoundVarChange);
    
    
GetConVarString(CVAR_SOUNDEXPLODE_SOUNDsizeof(EXPLODE_SOUND));
}

public 
OnMapStart()
{
    if(!
StrEqual(EXPLODE_SOUND""))
    {
        
PrecacheSound(EXPLODE_SOUNDtrue);
    }
}

public 
OnEntityCreated(entity)
{
    if(
IsValidEntity(entity))
    {
        new 
Stringclassname[32];
        
GetEntityClassname(entityclassnamesizeof(classname));
        if(
StrEqual(classname"chicken"))
        {
            if(!
StrEqual(EXPLODE_SOUND""))
            {
                
HookSingleEntityOutput(entity"OnBreak"OnBreak);
            }
        }
    }
}

public 
OnBreak(const Stringoutput[], calleractivatorFloatdelay)
{
    if(!
StrEqual(EXPLODE_SOUND""))
    {
        
g_iPontos[activator] = g_iPontos[activator] + 2;
        
decl String:nome[32];
        
GetClientName(activatornomesizeof(nome));
        
        
PrintToChatAll("Player %s Get%i points for kill a chicken"nome,g_iPontos);
        
EmitSoundToAll(EXPLODE_SOUNDcaller);
    }
}

public 
OnSoundVarChange(Handleconvar, const StringoldValue[], const StringnewValue[])
{
    if(!
StrEqual(oldValuenewValue))
    {
        
GetConVarString(CVAR_SOUNDEXPLODE_SOUNDsizeof(EXPLODE_SOUND));
        if(!
StrEqual(EXPLODE_SOUND""))
        {
            
PrecacheSound(EXPLODE_SOUNDtrue);
        }
    }

Dkmuniz is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 07-15-2015 , 01:56   Re: Chicken point! CSGO
Reply With Quote #7

It doesn't add points because you didn't tell it to.

PHP Code:
CS_SetClientContributionScore(client, (CS_GetClientContributionScore(client) + 2)); 
This should add 2 points I believe. (You're talking about in-game score right?)

Last edited by thecount; 07-15-2015 at 01:57.
thecount is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 07-15-2015 , 02:08   Re: Chicken point! CSGO
Reply With Quote #8

Quote:
Originally Posted by thecount View Post
It doesn't add points because you didn't tell it to.

PHP Code:
CS_SetClientContributionScore(client, (CS_GetClientContributionScore(client) + 2)); 
This should add 2 points I believe. (You're talking about in-game score right?)
No, is not in-game score, is points for my idea > If the player that have more points than others in 2 minutes, something happens
Dkmuniz is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 07-15-2015 , 11:51   Re: Chicken point! CSGO
Reply With Quote #9

An answer ?
Dkmuniz is offline
Darkness_
Veteran Member
Join Date: Nov 2014
Old 07-15-2015 , 11:55   Re: Chicken point! CSGO
Reply With Quote #10

The more you bump your post the less people are going to inclined to assist you.
Darkness_ is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode