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

[CS:GO] Enable carnival C4 defuse sound and animation


Post New Thread Reply   
 
Thread Tools Display Modes
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 08-26-2017 , 15:49   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #21

The update for CSGO birthday This will be fix soon.
__________________
vortex. is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 08-26-2017 , 15:57   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #22

Quote:
Originally Posted by vortex. View Post
The update for CSGO birthday This will be fix soon.
Yay happy birthday csgo xD
I meant that I really like how the taser has the same effects, and would like to be able to toggle it anytime on the server, via a plugin is that possible at all?
__________________
Obyboby is offline
stephen473
Senior Member
Join Date: Jan 2017
Location: somewhere on earth
Old 08-29-2017 , 14:31   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #23

It will work!

PHP Code:
#pragma semicolon 1

#define DEBUG


#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
#include <emitsoundany> 


#pragma newdecls required

#define particletime 5.0


public void OnPluginStart()
{
    
HookEvent("weapon_fire"Event_WeaponFire);
}

public 
void OnMapStart() 

    
PrecacheSoundAny("weapons/party_horn_01.wav"); 


public 
void Event_WeaponFire(Event event, const char[] namebool dontBroadcast)  

    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
IsValidClient(client))
    {
        
int Weapon GetEntPropEnt(clientProp_Send"m_hActiveWeapon");
        
        
char WeaponName[56];
        
        if (
IsValidEntity(Weapon))
        {
            
GetEdictClassname(WeaponWeaponNamesizeof(WeaponName));
        }
           
        if (
StrEqual(WeaponName"weapon_taser"))
        {
            
CreateParticle(client"weapon_confetti_balloons"particletime); 
        }
    }        
}


stock void CreateParticle(int entchar[] particleTypefloat time

    for (
int i 1<= MaxClientsi++) 
    { 
        if (
IsValidClient(i)) 
        { 
            
int particle CreateEntityByName("info_particle_system"); 
             
            
char name[64]; 
             
            if (
IsValidEdict(particle)) 
            { 
                
float position[3]; 
                
GetEntPropVector(entProp_Send"m_vecOrigin"position); 
                
TeleportEntity(particlepositionNULL_VECTORNULL_VECTOR); 
                
GetEntPropString(entProp_Data"m_iName"namesizeof(name)); 
                
DispatchKeyValue(particle"targetname""tf2particle"); 
                
DispatchKeyValue(particle"parentname"name); 
                
DispatchKeyValue(particle"effect_name"particleType); 
                
DispatchSpawn(particle); 
                
SetVariantString(name); 
                
AcceptEntityInput(particle"SetParent"particleparticle0); 
                
ActivateEntity(particle); 
                
AcceptEntityInput(particle"start"); 
                
CreateTimer(timeDeleteParticleparticle); 
            } 
            
EmitSoundToAllAny("weapons/party_horn_01.wav");   
        } 
        else 
StopSoundAny(i0"weapons/party_horn_01.wav"); 
    } 



public 
Action DeleteParticle(Handle timerany particle

    if (
IsValidEntity(particle)) 
    { 
        
char classN[64]; 
        
GetEdictClassname(particleclassNsizeof(classN)); 
        if (
StrEqual(classN"info_particle_system"false)) 
        { 
            
RemoveEdict(particle); 
        } 
    } 
}   

stock bool IsValidClient(int clientbool bAllowBots falsebool bAllowDead true)
{
    if(!(
<= client <= MaxClients) || !IsClientInGame(client) || (IsFakeClient(client) && !bAllowBots) || IsClientSourceTV(client) || IsClientReplay(client) || (!bAllowDead && !IsPlayerAlive(client)))
    {
        return 
false;
    }
    return 
true;

__________________
Also known as Hardy`.

Feel free to contact me if you have a private plugin request!

My Steam Profile | Discord: Hardy`#3792
stephen473 is offline
fiction
Member
Join Date: May 2017
Old 08-29-2017 , 17:33   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #24

Can't you just set sv_party_mode 1?
fiction is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 08-29-2017 , 17:58   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #25

Quote:
Originally Posted by fiction View Post
Can't you just set sv_party_mode 1?
+1

Quote:
Originally Posted by stephen473 View Post
It will work!

PHP Code:
#pragma semicolon 1

#define DEBUG


#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
#include <emitsoundany> 


#pragma newdecls required

#define particletime 5.0


public void OnPluginStart()
{
    
HookEvent("weapon_fire"Event_WeaponFire);
}

public 
void OnMapStart() 

    
PrecacheSoundAny("weapons/party_horn_01.wav"); 


public 
void Event_WeaponFire(Event event, const char[] namebool dontBroadcast)  

    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
IsValidClient(client))
    {
        
int Weapon GetEntPropEnt(clientProp_Send"m_hActiveWeapon");
        
        
char WeaponName[56];
        
        if (
IsValidEntity(Weapon))
        {
            
GetEdictClassname(WeaponWeaponNamesizeof(WeaponName));
        }
           
        if (
StrEqual(WeaponName"weapon_taser"))
        {
            
CreateParticle(client"weapon_confetti_balloons"particletime); 
        }
    }        
}


stock void CreateParticle(int entchar[] particleTypefloat time

    for (
int i 1<= MaxClientsi++) 
    { 
        if (
IsValidClient(i)) 
        { 
            
int particle CreateEntityByName("info_particle_system"); 
             
            
char name[64]; 
             
            if (
IsValidEdict(particle)) 
            { 
                
float position[3]; 
                
GetEntPropVector(entProp_Send"m_vecOrigin"position); 
                
TeleportEntity(particlepositionNULL_VECTORNULL_VECTOR); 
                
GetEntPropString(entProp_Data"m_iName"namesizeof(name)); 
                
DispatchKeyValue(particle"targetname""tf2particle"); 
                
DispatchKeyValue(particle"parentname"name); 
                
DispatchKeyValue(particle"effect_name"particleType); 
                
DispatchSpawn(particle); 
                
SetVariantString(name); 
                
AcceptEntityInput(particle"SetParent"particleparticle0); 
                
ActivateEntity(particle); 
                
AcceptEntityInput(particle"start"); 
                
CreateTimer(timeDeleteParticleparticle); 
            } 
            
EmitSoundToAllAny("weapons/party_horn_01.wav");   
        } 
        else 
StopSoundAny(i0"weapons/party_horn_01.wav"); 
    } 



public 
Action DeleteParticle(Handle timerany particle

    if (
IsValidEntity(particle)) 
    { 
        
char classN[64]; 
        
GetEdictClassname(particleclassNsizeof(classN)); 
        if (
StrEqual(classN"info_particle_system"false)) 
        { 
            
RemoveEdict(particle); 
        } 
    } 
}   

stock bool IsValidClient(int clientbool bAllowBots falsebool bAllowDead true)
{
    if(!(
<= client <= MaxClients) || !IsClientInGame(client) || (IsFakeClient(client) && !bAllowBots) || IsClientSourceTV(client) || IsClientReplay(client) || (!bAllowDead && !IsPlayerAlive(client)))
    {
        return 
false;
    }
    return 
true;

Yes, that's correct. But CSGO feature isn't like this. You are creating particle for client. CSGO is creating particle for zeus bullet.
__________________
vortex. is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 08-29-2017 , 19:16   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #26

Quote:
Originally Posted by fiction View Post
Can't you just set sv_party_mode 1?
Damn. Was completely unaware of that setting.
Would that allow me to enable all party related stuff at once? Defusesounds , Zeussounds , and chickens with hats??
__________________
Obyboby is offline
fiction
Member
Join Date: May 2017
Old 08-29-2017 , 20:28   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #27

Quote:
Originally Posted by Obyboby View Post
Damn. Was completely unaware of that setting.
Would that allow me to enable all party related stuff at once? Defusesounds , Zeussounds , and chickens with hats??
From the Counter-Strike wiki:
Quote:
Similar to holiday modes, when party mode is active, several cosmetic changes are made to assets in-game. For example, chickens wear party hats and explode confetti when killed, the Zeus x27s sprays confetti and plays noisemakers when fired, and the bomb releases confetti bursts and balloons when defused.
fiction is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 08-30-2017 , 03:41   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #28

Quote:
Originally Posted by fiction View Post
From the Counter-Strike wiki:
Damn!
That means I requested a plugin that is not even needed (kinda)
Sorry guys ^^'

Thanks for your awesome help tho!!!

Now that I think about it, those effects are fun but some users might be annoyed by the sound.
Having party mode 1 server side, but still allowing clients to turn it off if they want, is that possible?
__________________

Last edited by Obyboby; 08-30-2017 at 03:42.
Obyboby is offline
fiction
Member
Join Date: May 2017
Old 08-30-2017 , 14:06   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #29

Quote:
Originally Posted by Obyboby View Post
Now that I think about it, those effects are fun but some users might be annoyed by the sound.
Having party mode 1 server side, but still allowing clients to turn it off if they want, is that possible?
Just the Zeus sounds? If so yes, that should be possible with a simple sound hook.
fiction is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 08-31-2017 , 06:27   Re: [CS:GO] Enable carnival C4 defuse sound and animation
Reply With Quote #30

Quote:
Originally Posted by fiction View Post
Just the Zeus sounds? If so yes, that should be possible with a simple sound hook.
Both.
I mean, set sv_party_mode 1 and then each client can have a setting to disable either the animations, the sound, or both, on both the C4 and zeus (doubt anyone would want to disable the effects on the bomb but keep them on the zeus, or vice versa. Either they like them or not lol)

Example client side menu:

Code:
PARTY MODE

1. Toggle sounds (ON/OFF)
2. Toggle party effects (ON/OFF)
This would make more sense than:

Code:
PARTY MODE

1. Toggle C4 sounds (ON/OFF)
2. Toggle C4 effects (ON/OFF)
3. Toggle Zeus sounds (ON/OFF)
4. Toggle Zeus effects (ON/OFF)
__________________

Last edited by Obyboby; 08-31-2017 at 06:30.
Obyboby 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 11:15.


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