Raised This Month: $ Target: $400
 0% 

HE Damage Sound. Add stuff complete! time to checking for error's.


Post New Thread Reply   
 
Thread Tools Display Modes
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 11-23-2008 , 07:12   Re: HE Damage Sound. (Add stuff. but. Error)
Reply With Quote #11

Call function... how to add call function.. i try copy paste code. but not work
__________________
ilham92-cc-sakura is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 11-23-2008 , 07:20   Re: HE Damage Sound. (Add stuff. but. Error)
Reply With Quote #12

Quote:
set_task(10.10,"respawnagain",victim);
That's actually like this(but only after 10secs):
respawnagain(victim);

So if you want to call that, you should make the function:
public respawnagain(id)
{
//Here is your respawn again code
}
SnoW is offline
Send a message via MSN to SnoW
Old 11-23-2008, 07:37
SnoW
This message has been deleted by SnoW.
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 11-23-2008 , 07:42   Re: HE Damage Sound. (Add stuff. but. Error)
Reply With Quote #13

Code:
/*
        I'm hurt! HE make me can't listen for while!

        Extra stuff for Grenade Enhancer by anakin_cstrike
        
        This plugins will play sound when HE throw and player get
        damage from HE. Hurt Sound will be played.
        
        More real style HE damage like Half-Life 2 and Call of Duty 4
        Download: http://forums.alliedmods.net/showthread.php?p=651536
        
        © Copyright 2008 ANiME clan.
        Visit: http://ilham92-cc-sakura.webs/
    Under License GNU
    
    English help by: [ANiME|ADMiN][5hp-Evolution]
    Created by: [ANiME|ADMiN][Ilham Sakura] aka ilham92-cc-sakura

*/

#include <amxmodx>
#include <csx>
#include <fakemeta_util>

// Sound to de played
#define SND1 "player/player_listen.wav"
#define SND2 "player/breathe1noloop.wav"

public plugin_init()
{
    register_plugin("HE Player Damage Snd", "1.0","ilham92-cc-sakura");
}
public plugin_precache()
{
    precache_sound(SND1);
    precache_sound(SND2);
}
public client_damage(attacker,victim,damage,wpnindex,hitplace,TA)
{
    if((wpnindex != CSW_HEGRENADE)&& (wpnindex != CSW_C4))
        return PLUGIN_HANDLED;
    
    new sound1[129];
    copy(sound1,128,SND1);
    if (containi(sound1,".wav"))
    {
        replace(sound1,128,".wav","");
        client_cmd(0, "spk %s",sound1);
    }
    new sound2[131];
    copy(sound2,130,SND2);
    if (containi(sound2,".wav"))
    {
        replace(sound1,130,".wav","");
        client_cmd(0, "spk %s",sound2);
    }

    new pl_name[32]
    get_user_name(victim,pl_name, 31);
    
    client_cmd(0, "say Damn it! HE Grenade Hit Me!",victim);
    client_print(0, print_chat, "[Grenade]: At who trow grenade. %s! it is time for a payback",pl_name);
    
    if(!is_user_alive(victim))
    {set_task(10.10,"respawnagain",victim);
    }
    if (get_user_team(victim)==1)
    {
        fm_give_item(victim,"weapon_mp5navy");
        fm_give_item(victim,"ammo_9mm");
        fm_give_item(victim,"ammo_9mm");
        fm_give_item(victim,"ammo_9mm");
        fm_give_item(victim,"ammo_9mm");
    }
    return PLUGIN_CONTINUE;
}
 
public respawnagain(id)
{
      fm_cs_user_spawn(victim);
}
I think that won't work yet, just fixed the function thingy.
SnoW is offline
Send a message via MSN to SnoW
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 11-23-2008 , 08:54   Re: HE Damage Sound. (Add stuff. but. Error)
Reply With Quote #14

OK. This have Fix a lot! use pcvar!

Cvar
he_hit_respawn #
default 1.
1-Respawn when kill by HE Grenade
0-Not Respawn when kill by HE Grenade

When HE hit player. auto give weapon on.
When HE hit/kill player. Sound damage played

PHP Code:
/*
        I'm hurt! HE make me can't listen for while!

        Extra stuff for Grenade Enhancer by anakin_cstrike
        
        This plugins will play sound when HE throw and player get
        damage from HE. Hurt Sound will be played.
        
        More real style HE damage like Half-Life 2 and Call of Duty 4
        Download: http://forums.alliedmods.net/showthread.php?p=651536
        
        © Copyright 2008 ANiME clan.
        Visit: http://ilham92-cc-sakura.webs/
    Under License GNU
    
    English help by: [ANiME|ADMiN][5hp-Evolution]
    Created by: [ANiME|ADMiN][Ilham Sakura] aka ilham92-cc-sakura
    Scripting Help: SnoW

*/

#include <amxmodx>
#include <csx>
#include <fakemeta_util>

// Sound to de played
#define SND1 "player/player_listen.wav"
#define SND2 "player/breathe1noloop.wav"
new amx_pcvar_0

public plugin_init()
{
    
register_plugin("HE Player Damage Snd""1.0","ilham92-cc-sakura");
    
amx_pcvar_0 register_cvar("he_hit_respawn","1");
}
public 
plugin_precache()
{
    
precache_sound(SND1);
    
precache_sound(SND2);
}
public 
client_damage(attacker,victim,damage,wpnindex,hitplace,TA)
{
    if(
wpnindex != CSW_HEGRENADE)
    return 
PLUGIN_HANDLED;
    
    new 
sound1[129];
    
copy(sound1,128,SND1);
    if (
containi(sound1,".wav"))
    {
        
replace(sound1,128,".wav","");
        
client_cmd(0"spk %s",sound1);
    }
    new 
sound2[131];
    
copy(sound2,130,SND2);
    if (
containi(sound2,".wav"))
    {
        
replace(sound1,130,".wav","");
        
client_cmd(0"spk %s",sound2);
    }

    new 
pl_name[32]
    
get_user_name(victim,pl_name31);
    
    
client_cmd(0"say Damn it! HE Grenade Hit Me!",victim);
    
client_print(0print_chat"[Grenade]: At who trow grenade. %s! it is time for a payback",pl_name);
    
    if (
get_user_team(victim)==1)
    {
        
fm_give_item(victim,"weapon_mp5navy");
        
fm_give_item(victim,"item_kevlar");
        
fm_give_item(victim,"ammo_9mm");
        
fm_give_item(victim,"ammo_9mm");
        
fm_give_item(victim,"ammo_9mm");
        
fm_give_item(victim,"ammo_9mm");
    }
    if (
get_pcvar_num(amx_pcvar_0) == 0)
    return 
PLUGIN_CONTINUE;
    if(!
is_user_alive(victim))
    {
        
set_task(0.6,"respawnagain",victim);
        
client_print(0print_chat"[Grenade]: HE kill %s and respwan.",pl_name);
        
client_cmd(0"say I will get you for my revenge!");
    }
    return 
PLUGIN_CONTINUE;
}
public 
respawnagain(victim)
{
    
fm_cs_user_spawn(victim);

__________________

Last edited by ilham92-cc-sakura; 11-23-2008 at 09:04.
ilham92-cc-sakura is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 11-23-2008 , 10:38   Re: HE Damage Sound. Add stuff complete! time to checking for error's.
Reply With Quote #15

I think you should use there return PLUGIN_HANDELD, when the pcvar is 0. Its default is 1, so...
SnoW is offline
Send a message via MSN to SnoW
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 11-23-2008 , 10:41   Re: HE Damage Sound. Add stuff complete! time to checking for error's.
Reply With Quote #16

Quote:
Originally Posted by SnoW View Post
I think you should use there return PLUGIN_HANDELD, when the pcvar is 0. Its default is 1, so...
Convert this?
PHP Code:
    if (get_pcvar_num(amx_pcvar_0) == 0)
    return 
PLUGIN_CONTINUE
to
PHP Code:
    if (get_pcvar_num(amx_pcvar_0) == 0)
    return 
PLUGIN_HANDELD
but. i have try 10 time and play with bot and player...
and try turn to 0... is work...
__________________
ilham92-cc-sakura is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 11-23-2008 , 10:44   Re: HE Damage Sound. Add stuff complete! time to checking for error's.
Reply With Quote #17

The pcvar value is only that, if you want that 1 is on, you have to Close the plugin when the amount is 0, if you want 1 is off, then upside down. Anyway you should probably make the default so the plugin is on.
SnoW is offline
Send a message via MSN to SnoW
ilham92-cc-sakura
Senior Member
Join Date: Oct 2008
Location: /var/www/index.html
Old 11-23-2008 , 10:48   Re: HE Damage Sound. Add stuff complete! time to checking for error's.
Reply With Quote #18

Quote:
Originally Posted by SnoW View Post
The pcvar value is only that, if you want that 1 is on, you have to Close the plugin when the amount is 0, if you want 1 is off, then upside down. Anyway you should probably make the default so the plugin is on.
Oh... need to change! because! i have post at new plugins submission!
__________________
ilham92-cc-sakura is offline
mariusz
BANNED
Join Date: Jul 2009
Old 07-29-2009 , 12:33   Re: HE Damage Sound. Add stuff complete! time to checking for error's.
Reply With Quote #19

can u make somethink like that for me i mean i dont want that mp5 its payback i just want respawn n masage that says ill get u for my revange! n this half life sound too could u make one like that for me?
mariusz 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 06:09.


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