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

Blood Color/Amount Management


Post New Thread Reply   
 
Thread Tools Display Modes
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 03-08-2018 , 01:54   Re: Blood Color/Amount Management
Reply With Quote #81

For Random Blood Color, use this

PHP Code:
/*
*   _______     _      _  __          __
*  | _____/    | |    | | \ \   __   / /
*  | |         | |    | |  | | /  \ | |
*  | |         | |____| |  | |/ __ \| |
*  | |   ___   | ______ |  |   /  \   |
*  | |  |_  |  | |    | |  |  /    \  |
*  | |    | |  | |    | |  | |      | |
*  | |____| |  | |    | |  | |      | |
*  |_______/   |_|    |_|  \_/      \_/
*
*
*
*  Last Edited: 07-04-09
*
*  ============
*   Changelog:
*  ============
*
*  v2.0
*    -Changed blood_amount to blood_gore
*    -Added arkshine's HAM method of changing blood color
*    -Changed how gore sprites are sent
*
*  v1.0
*    -Initial Release
*
*/

#define VERSION    "2.0"

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define TE_BLOODSPRITE 115

new blood
new blood_gore
//new blood_color
stock const s_chColors[] =
{
    
000007015031047063079095103,
    
106110111123127128130144146,
    
160165176179192193196202208,
    
212216225231234237238239240,
    
241242243244245246248249250,
    
251252253255
}

public 
plugin_init()
{
    
register_plugin("Blood Color/Amount Management",VERSION,"GHW_Chronic")
    
register_event("Damage","Damage","3=DMG_BULLET")
    
register_concmd("amx_bloodcolors","cmdbc")
    
blood_gore register_cvar("blood_gore","1")
    
//blood_color = register_cvar("blood_color","110")
    
RegisterHam(Ham_BloodColor,"player","Hook_BloodColor")
}

public 
plugin_precache()
{
    
blood precache_model("sprites/blood.spr")
}

public 
Hook_BloodColor(id)
{
    
SetHamReturnInteger(s_chColors[random(sizeof(s_chColors)-1)])
    return 
HAM_SUPERCEDE;
}

public 
Damage(id)
{
    if(
is_user_connected(id) && get_user_health(id)!=100 && get_pcvar_num(blood_gore))
    {
        new 
origin[3]
        
get_user_origin(id,origin)
        new 
hitpointweapon
        get_user_attacker
(id,weapon,hitpoint)
        switch(
hitpoint)
        {
            case 
1:
            {
                
get_user_origin(id,origin,1)
            }
            case 
2:
            {
                
origin[2] += 25
            
}
            case 
3:
            {
                
origin[2] += 10
            
}
            case 
4:
            {
                
origin[2] += 10
                origin
[0] += 5
                origin
[1] += 5
            
}
            case 
5:
            {
                
origin[2] += 10
                origin
[0] -= 5
                origin
[1] -= 5
            
}
            case 
6:
            {
                
origin[2] -= 10
                origin
[0] += 5
                origin
[1] += 5
            
}
            case 
7:
            {
                
origin[2] -= 10
                origin
[0] -= 5
                origin
[1] -= 5
            
}
        }
        if(
get_pcvar_num(blood_gore))
        {
            
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
            
write_byte(TE_BLOODSPRITE)
            
write_coord(origin[0])
            
write_coord(origin[1])
            
write_coord(origin[2])
            
write_short(blood)
            
write_short(blood)
            
write_byte(s_chColors[random(sizeof(s_chColors)-1)])
            
write_byte(10)
            
message_end()
            
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
            
write_byte(TE_BLOODSPRITE)
            
write_coord(origin[0])
            
write_coord(origin[1])
            
write_coord(origin[2])
            
write_short(blood)
            
write_short(blood)
            
write_byte(s_chColors[random(sizeof(s_chColors)-1)])
            
write_byte(12)
            
message_end()
            
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
            
write_byte(TE_BLOODSPRITE)
            
write_coord(origin[0])
            
write_coord(origin[1])
            
write_coord(origin[2])
            
write_short(blood)
            
write_short(blood)
            
write_byte(s_chColors[random(sizeof(s_chColors)-1)])
            
write_byte(15)
            
message_end()
        }
    }
}

public 
cmdbc(id)
{
    
show_motd(id,"<body bgcolor=black><center><font color=white><B>Note: Only colors after 127 work!</B><BR><BR><img src=^"http://forums.alliedmods.net/attachment.php?attachmentid=5979&d=1146477307^"></font></center></body>","Colors")
    
return PLUGIN_HANDLED

Attached Files
File Type: sma Get Plugin or Get Source (GHW_Blood_Color.sma - 594 views - 3.7 KB)
__________________

Last edited by CrAzY MaN; 03-08-2018 at 01:55.
CrAzY MaN is offline
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 08:08.


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