Raised This Month: $219 Target: $400
 54% 

To help new plug-in


Post New Thread Reply   
 
Thread Tools Display Modes
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-17-2020 , 11:49   Re: To help new plug-in
Reply With Quote #11

#include <amxmodx>

#define PLUGIN "Headshot Sound"
#define VERSION "1.0"
#define AUTHOR "Author"

new const soundfile[]="misc/head.wav" //soundfile name here

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
}

public plugin_precache() precache_sound(soundfile)

public client_death(iKiller, iVictim, iWpnIndex, iHitPlace)
{
if(iHitPlace == HIT_HEAD)
{
client_cmd(iKiller, "wav play %s", soundfile)
}
}
wy19850 is offline
Send a message via Skype™ to wy19850
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-17-2020 , 12:26   Re: To help new plug-in
Reply With Quote #12

#include <amxmod>

new PLUGIN_NAME[] = "Headshot Sound"
new PLUGIN_AUTHOR[] = "Cheap_Suit"
new PLUGIN_VERSION[] = "1.2"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("DeathMsg", "Event_Death", "a")
}

public plugin_precache() {
precache_sound("misc/hpain3.wav")
}

public Event_Death()
{
new victim = read_data(2)

new victimTeam[16]
get_user_team(victim, victimTeam, 15)

new players[32], playerCnt
get_players(players, playerCnt, "ae", victimTeam)

for(new i = 0; i < playerCnt; i++) {
client_cmd(players[i], "spk misc/hpain3.wav")
}
}

Last edited by wy19850; 02-17-2020 at 12:27.
wy19850 is offline
Send a message via Skype™ to wy19850
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-17-2020 , 12:35   Re: To help new plug-in
Reply With Quote #13

  client_cmd (iKiller wav玩% s, soundfile)
  
  改成
  
  
  client_cmd (iKiller“spk misc / head.wav”)



Is working properly now, only a head die has a WAV or MP3, the body without the sound
wy19850 is offline
Send a message via Skype™ to wy19850
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-17-2020 , 12:36   Re: To help new plug-in
Reply With Quote #14

Inspiration comes from client_cmd (players [I], "SPK misc/hpain3 wav")
wy19850 is offline
Send a message via Skype™ to wy19850
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-17-2020 , 12:39   Re: To help new plug-in
Reply With Quote #15

Quote:
Originally Posted by Sanjay Singh View Post
Try
PHP Code:
#include <amxmodx>

#define PLUGIN  "Headshot Sound"
#define VERSION "1.0"
#define AUTHOR  "Author"

new const soundfile[]="misc/headshot.mp3" //soundfile name here

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache()    precache_sound(soundfile)

public 
client_death(iKilleriVictimiWpnIndexiHitPlace)
{
    if(
iHitPlace == HIT_HEAD)
    {
        
client_cmd(iKiller"mp3 play %s"soundfile)
    }








Thank you very much, thank you for your help, I wish you good luck.
wy19850 is offline
Send a message via Skype™ to wy19850
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-17-2020 , 12:41   Re: To help new plug-in
Reply With Quote #16

*
*
*
*Thank you very much, thank you for your help, I wish you good luck

*
*
*
#include <amxmodx>

#define PLUGIN "Headshot Sound"
#define VERSION "1.0"
#define AUTHOR "Author"

new const soundfile[]="misc/head.wav" //soundfile name here

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
}

public plugin_precache() precache_sound(soundfile)

public client_death(iKiller, iVictim, iWpnIndex, iHitPlace)
{
if(iHitPlace == HIT_HEAD)
{
client_cmd(iKiller, "spk misc/head.wav")
}
}
wy19850 is offline
Send a message via Skype™ to wy19850
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-17-2020 , 12:43   Re: To help new plug-in
Reply With Quote #17

Thank you very much, thank you for your help, I wish you good luck
wy19850 is offline
Send a message via Skype™ to wy19850
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 02-17-2020 , 14:41   Re: To help new plug-in
Reply With Quote #18

wtf
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: All over the place.
Old 02-17-2020 , 14:49   Re: To help new plug-in
Reply With Quote #19

Quote:
Originally Posted by Sanjay Singh View Post
Try
PHP Code:
#include <amxmodx>

#define PLUGIN  "Headshot Sound"
#define VERSION "1.0"
#define AUTHOR  "Author"

new const soundfile[]="misc/headshot.mp3" //soundfile name here

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache()    precache_sound(soundfile)

public 
client_death(iKilleriVictimiWpnIndexiHitPlace)
{
    if(
iHitPlace == HIT_HEAD)
    {
        
client_cmd(iKiller"mp3 play %s"soundfile)
    }

Quote:
Originally Posted by wy19850 View Post
  client_cmd (iKiller wav玩% s, soundfile)
  
  改成
  
  
  client_cmd (iKiller“spk misc / head.wav”)



Is working properly now, only a head die has a WAV or MP3, the body without the sound

MP3 is generic cache.


Example.
Code:
new const SOUND_SANI[] = "sound/misc/sani.mp3" precache_generic(SOUND_SANI);
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty — a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 02-17-2020 at 14:54.
DJEarthQuake is offline
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-18-2020 , 12:34   Re: To help new plug-in
Reply With Quote #20

Quote:
Originally Posted by DJEarthQuake View Post
MP3 is generic cache.


Example.
Code:
new const SOUND_SANI[] = "sound/misc/sani.mp3" precache_generic(SOUND_SANI);
*
*
*
*非常感谢,谢谢您的帮助,祝您好运

*
*
*
#include <amxmodx>

#define PLUGIN“ Headshot Sound”
#define VERSION“ 1.0”
#define AUTHOR“ Author”

新的const声音文件[] =“ misc / head.wav” //此处为声音文件名

public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
}

public plugin_precache()precache_sound(

soundfile )public client_death(iKiller,iVictim,iWpnIndex,iHitPl ace)
{
如果(iHitPlace == HIT_HEAD)
{
client_cmd(iKiller,“ spk misc / head.wav”)
}
}






Only a shot in the head of death, the voice heard, only my own how to let the players also can hear the sound
wy19850 is offline
Send a message via Skype™ to wy19850
Reply


Thread Tools
Display Modes

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 05:12.


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