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

Solved [CSGO] how to check for the female character model?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 05-01-2023 , 21:10   [CSGO] how to check for the female character model?
Reply With Quote #1

I wrote a plugin to play certain death sounds in the
"player_death" event.

CSGO has a female character.
How would I tell the player that just died had the female character model?

Last edited by Austin; 05-03-2023 at 02:26.
Austin is offline
bklol
Member
Join Date: May 2019
Location: on my chair
Old 05-02-2023 , 06:20   Re: [CSGO] how to check for the female character model?
Reply With Quote #2

cheak client model index or model path
bklol is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 05-02-2023 , 14:36   Re: [CSGO] how to check for the female character model?
Reply With Quote #3

GetClientModel(int client, char[] model, int maxlen)
https://www.sourcemod.net/new-api/cl...GetClientModel
__________________
Grey83 is offline
Austin
Senior Member
Join Date: Oct 2005
Old 05-03-2023 , 02:18   Re: [CSGO] how to check for the female character model?
Reply With Quote #4

Quote:
Originally Posted by Grey83 View Post
GetClientModel(int client, char[] model, int maxlen)
https://www.sourcemod.net/new-api/cl...GetClientModel
This was to add on to a death sounds plugin I wrote.
I have all the other player death sounds, just needed to add these based on the model.

Test code, It works!
PHP Code:
#pragma newdecls required
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

char femSounds[][] =
{
    
"player/death_fem_01.wav",
    
"player/death_fem_02.wav",
    
"player/death_fem_03.wav",
    
"player/death_fem_04.wav",
    
"player/death_fem_05.wav",
    
"player/death_fem_06.wav",
    
"player/death_fem_07.wav",
    
"player/death_fem_08.wav"
};
int nFemSounds sizeof(femSounds);
int cFemSounds 0;

public 
void OnPluginStart()
{
    
HookEvent("player_death",    Event_PlayerDeath,    EventHookMode_Post);
}

public 
Action Event_PlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
char model[250];
    
GetClientModel(clientmodel250);
    
//PrintToChatAll(model);
    //DebugLog(model);
    
    
float victimLocation[3];
    
GetClientAbsOrigin(clientvictimLocation);

    if (
StrEqual(model"models/player/custom_player/legacy/ctm_fbi_variantB.mdl"false) )
        
PlayDeathSound(femSoundscFemSoundsnFemSounds1victimLocation);
    return 
Plugin_Continue;
}

public 
void PlayDeathSound(const char[][] sndintcSndint nSndint timesfloat loc[3])
{
    
//  play the death sound to all humans with distance and direction information
    
for (int client=1client <= MaxClientsclient++)
        if (
IsClientInGame(client) && IsPlayerAlive(client) && !IsFakeClient(client))
            for (
int t=1<= timest++)
            {
                
EmitSoundToClient(client,snd[cSnd],SOUND_FROM_WORLDSNDCHAN_AUTOSNDLEVEL_AIRCRAFTSND_NOFLAGSSNDVOL_NORMALSNDPITCH_NORMAL, -1loc);
                if (++
cSnd >= nSnd)
                    
cSnd 0;
            }            
}

public 
void OnMapStart()
{    
    for(
int i=0nFemSoundsi++)
        
PrecacheSound(femSounds[i], true);

tx

Last edited by Austin; 05-03-2023 at 02:21.
Austin 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 08:19.


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