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

[solved] Change Blood Color


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 07-03-2009 , 00:23   [solved] Change Blood Color
Reply With Quote #1

I want to change the blood color for a particular player or group of players, not all players.

I'm having trouble doing this properly. Right now, I'm doing it in a very "hackish" way and the results are bad.

I'm hooking TE_BLOODSTREAM, TE_BLOOD, TE_BLOODSPRITE, reading the coordinates, finding the ent at the coords, and then checking if the ent is the right one. It's not precise and it doesn't work well.

I only found two relevant threads on the forum:
https://forums.alliedmods.net/showthread.php?t=61812
https://forums.alliedmods.net/showthread.php?t=3464

I didn't have any success playing with pdata, but maybe I'm doing it wrong. Has anyone done this properly?
__________________

Last edited by stupok; 07-03-2009 at 14:00.
stupok is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-03-2009 , 00:52   Re: Change Blood Color
Reply With Quote #2

Quote:
/**
* Description: Normally returns the blood color of the entity.
* Forward params: function(this)
* Return type: Integer.
* Execute params: ExecuteHam(Ham_BloodColor, this)
*/
Ham_BloodColor,
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-03-2009 , 00:55   Re: Change Blood Color
Reply With Quote #3

Try m_bloodColor (89) at player's spawn or Ham_BloodColor.
__________________
Arkshine is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-03-2009 , 00:59   Re: Change Blood Color
Reply With Quote #4

set_pdata_int( id, 89, 195 ) on Ham_Spawn post works

However, the decals on the wall are still red

I'm thinking about what to do about that...
__________________
stupok is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-03-2009 , 01:09   Re: Change Blood Color
Reply With Quote #5

Did you try to hook Ham_BloodColor ? Because It's called in TraceAttack().
__________________
Arkshine is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-03-2009 , 01:22   Re: Change Blood Color
Reply With Quote #6

I tested Ham_BloodColor a long time ago, and I didn't have success. Maybe I was doing it wrong

Anyways, I don't think Ham_BloodColor will suffice for the red blood decals on the wall.

So, the solution is to record the red and yellow blood decal indexes and then write the yellow one after Ham_TraceAttack is called on the target player. If you want more details, I can write some real code.
__________________
stupok is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-03-2009 , 01:47   Re: Change Blood Color
Reply With Quote #7

Record, you could harcode them like in HL :

#define BLOOD_COLOR_RED (BYTE)247
#defineBLOOD_COLOR_YELLOW (BYTE)195
__________________
Arkshine is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 07-03-2009 , 02:10   Re: Change Blood Color
Reply With Quote #8

try to set "env_blood" entity's pev_impluse for it's color and pev_dmg for it's amount after it spawned
don't know if it works, never change the blood's color.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-03-2009 , 11:15   Re: Change Blood Color
Reply With Quote #9

Doing that, it works and for decal too :

Code:
    #include <amxmodx>     #include <hamsandwich>         const BLOOD_COLOR_YELLOW = 195;         public plugin_init()     {         RegisterHam( Ham_BloodColor, "player", "CPlayer_BloodColor" );     }         public CPlayer_BloodColor ( const Player )     {         SetHamReturnInteger( BLOOD_COLOR_YELLOW );         return HAM_SUPERCEDE;     }

Edit : Actually decal color ( for other color ) is not changed and I don't think it's possible to change it since there is not color param for TE_WORLDDECAL or TE_DECAL.
__________________

Last edited by Arkshine; 07-03-2009 at 12:34.
Arkshine is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-03-2009 , 12:55   Re: Change Blood Color
Reply With Quote #10

@arkshine
Wow, this is confusing me.

You said it does not work for decal color. I confirmed this last week when I tested Ham_BloodColor.

Today, I'm testing it again, and decal color is successfully changed.
__________________
stupok 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 04:25.


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