AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Death And Damage 1.1 - 13/03/10 (https://forums.alliedmods.net/showthread.php?t=104879)

Asd' 09-28-2009 14:18

Death And Damage 1.1 - 13/03/10
 
2 Attachment(s)
Description:
This plugin it does is create a ScreenShake/ScreenFade on damage or die.

There are 4 modes of screenfade colors:
Quote:

* amx_fademodes_damage/death 0: This mode is the default mode, the screenfade is white color.
* amx_fademodes_damage/death 1: This mode is the define mode, the screenfade color is determined for cvars.
* amx_fademodes_damage/death 2: This mode is the random mode, the screenfade is random color.
* amx_fademodes_damage/death 3: This mode is the team mode, the screenfade is red or blue color.
Cvars:
Quote:

amx_fadeduration_damage 1:
XXX: Define the time duration of the screenfade in damage.

amx_fadeduration_death 10:
XXX: Defines the time duration of the screenfade in death.

amx_fadecolors_damage 250 0 0 250:
XXX: Defines the color of screenfade in damage.

amx_fadecolors_death 0 0 0 250:
XXX: Defines the color of screenfade in death.

amx_shakeduration_damage 1:
XXX: Define the time duration of the screenshake in damage.

amx_fademodes_damage/death 0:
0: Active the default mode.
1: Active the define mode.
2: Active the random mode.
3: Active the team mode.
Credits:
Quote:

IneedHelp
Changelog:
Quote:

Version 1.0:
- Fixed plugin.
- Updated plugin.
Version 1.1:
- Updated Thread.
- Fixed all errors/bugs found.
- Optimization.

fang 09-28-2009 14:20

Re: Death & Damage Realistic.
 
.Rar -> .zip

Sounds cool. I'll try it out later when I get some time.

alan_el_more 09-28-2009 14:21

Re: Death & Damage Realistic.
 
PHP Code:

public plugin_precache()
{
    
// Sounds precache
    
for (new 0sizeof HumanPaini++)
        
engfunc(EngFunc_PrecacheSoundHumanPain[i])
    for (new 
0sizeof HumanDeadi++)
        
engfunc(EngFunc_PrecacheSoundHumanDead[i])


:arrow:

PHP Code:

public plugin_precache()
{
    
// Sounds precache
    
for (new 0sizeof HumanPaini++)
        
engfunc(EngFunc_PrecacheSoundHumanPain[i])
    for (new 
0sizeof HumanDeadi++)
        
engfunc(EngFunc_PrecacheSoundHumanDead[i])



larito 09-28-2009 15:17

Re: Death & Damage Realistic.
 
Very nice, but you donīt copy my message of "customize start/end" XD

Exolent[jNr] 09-28-2009 15:21

Re: Death & Damage Realistic.
 
Quote:

Originally Posted by Asd' (Post 946000)
PHP Code:

////////////////////////// Customization start here //////////////////////////

// Killed
const RedKilled 0
const GreenKilled 0
const BlueKilled 0
const AlphaKilled 200

// Damage
const Red 250
const Green 0
const Blue 0
const Alpha 200

// Fade
const Fade 0x0000
const UnitSecond = (1<<12)

// Sounds realistics
new const HumanPain[][] = { "RealisticSD/HumanPain1.wav""RealisticSD/HumanPain2.wav""RealisticSD/HumanPain3.wav""RealisticSD/HumanPain4.wav""RealisticSD/HumanPain5.wav""RealisticSD/HumanPain6.wav" }
new const 
HumanDead[][] = { "RealisticSD/HumanDead1.wav""RealisticSD/HumanDead2.wav""RealisticSD/HumanDead3.wav""RealisticSD/HumanDead4.wav""RealisticSD/HumanDead5.wav" }

////////////////////////// Customization end here ////////////////////////// 


Make cvars for the colors.
Make a cvar for the fade duration.
There is no need to customize the fade flag.
Read a .ini file for custom sounds if server owners want to change them.

Starsailor 09-28-2009 16:04

Re: Death & Damage Realistic.
 
PHP Code:

    Red register_cvar("amx_reddmg""250")
    
Green register_cvar("amx_greendmg""0")
    
Blue register_cvar("amx_bluedmg""0")
    
Alpha register_cvar("amx_alphadmg""200"

Could be --->

PHP Code:

    new pColor 
    
    
//Plugin Init
    
pColor register_cvar("amx_damage_color","250 0 0 200"// R G B ALPHA
    
    
    
    //Then, in your function --->
    
    
new szPcvarColor[32], szRed[4], szGreen[4], szBlue[4], szAlpha[4]
    
get_pcvar_string(pColorszPcvarColor31)
    
parse(szPcvarColor,szRed,3,szGreen,3,szBlue,3,szAlpha,3)
    
    
//...
    
message_begin(MSG_ONE_UNRELIABLEScreenFade_victim)
    
write_short(UnitSecond*get_pcvar_num(FadeTimeDmg))
    
write_short(UnitSecond*0)
    
write_byte(clamp(str_to_num(szRed),0,255))
    
write_byte(clamp(str_to_num(szGreen),0,255))
    
write_byte(clamp(str_to_num(szBlue),0,255))
    
write_byte(str_to_num(szAlpha))
    
message_end() 


Also in

PHP Code:

public Killed(victim)



Starsailor 09-28-2009 16:29

Re: Death & Damage Realistic.
 
PHP Code:

public Killed(victim)
{
        
message_begin(MSG_ONE_UNRELIABLEScreenFade_victim)
        
write_short(get_pcvar_num(FadeTimeKilled))
        
write_short(10000)
        
write_short(Fade)
        
write_byte(get_pcvar_num(RedKilled))
        
write_byte(get_pcvar_num(GreenKilled))
        
write_byte(get_pcvar_num(BlueKilled))
        
write_byte(get_pcvar_num(AlphaKilled))
        
message_end()
    }
    
    
// Damage
public TKDamage(victimattackerFloat:damage)
{
    if (
victim != attacker && damage 0)
    {
            
message_begin(MSG_ONE_UNRELIABLEScreenFade_victim)
            
write_short(UnitSecond*get_pcvar_num(FadeTimeDmg))
            
write_short(UnitSecond*0)
            
write_byte(get_pcvar_num(Red))
            
write_byte(get_pcvar_num(Green))
            
write_byte(get_pcvar_num(Blue))
            
write_byte(get_pcvar_num(Alpha))
            
message_end() 

FAIL.

See Here

Sholud be
PHP Code:

public Killed(victim)
{
            
message_begin(MSG_ONE_UNRELIABLEScreenFade_victim)
            
write_short(UnitSecond*get_pcvar_num(FadeTimeKilled))
            
write_short(UnitSecond*0//..IDK if this is correct
            
write_short(Fade)
            
write_byte()//R
            
write_byte()//G
            
write_byte()//B
            
write_byte()//Alpha
            
message_end()
            
public 
TKDamage(victimattackerFloat:damage)
{
    if (
victim != attacker && damage 0)
    {
            
message_begin(MSG_ONE_UNRELIABLEScreenFade_victim)
            
write_short(UnitSecond*get_pcvar_num(FadeTimeDmg))
            
write_short(UnitSecond*0)
            
write_short(Fade)
            
write_byte()//R
            
write_byte()//G
            
write_byte()//B
            
write_byte()//Alpha
            
message_end() 


gladius 09-28-2009 21:44

Re: Death & Damage Realistic.
 
good plugin and ...remember me "i am your father" hahaha (L)

#8 SickneSS 09-28-2009 21:47

Re: Death & Damage Realistic.
 
Good Job Negracow;D

10100011 09-28-2009 23:29

Re: Death & Damage Realistic.
 
Title
---->
Realistic damage & death


All times are GMT -4. The time now is 23:30.

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