Description
Simple plugin. When a valid victim dies, a sprite will show on his death location. Message will be shown(Customizable)
Key features
- Useful CVars
- Simple config(.cfg) file
- Bug-free
- No hardcoded paths
- Multiple sprites
- Random sprites or specified sprites via CVars
CVars
Code:
// [Toggle On/Off]
zp_death_sprite "1" // [0 - Disable | 1 - Enable] Default: 1
// [Death sprite's brightness]
zp_death_sprite_brightness "255" // [0 - Darkest | 255 - Brightest] Default: 255
// [What message?] | NOTE: To disable this, replace it with zp_death_sprite_message ""
zp_death_sprite_message "[R]est.[i]n.[P]eace. - Grim Reaper" // [Max letters(including spaces) - 192]
//Default: [R]est.[i]n.[P]eace. - Grim Reaper
// [Delay to show sprite in decimals]
zp_death_sprite_delay "1.0" // E.g. 5.0, 3.5 , 2.7 | Default: 1.0
// [Random or specified sprite] | NOTE: It can be changed during in-game
zp_death_sprite_play "0" // [0 - Random || 1 ~ MAX_SPRITES (See source code for more info) - Specified] Default: 0
// NOTE: All CVars are updated every new round.
Customization
1. At line 5~9, you should see this
PHP Code:
// Customization(You do not need to add "sprites/")
new const DEATH_SPRITE[][] =
{
"93skull1" // zp_death_sprite_play 1
}
2. Then, change 93skull1 to your custom sprite. File extension is NOT REQUIRED. And you DO NOT need to add "sprites/" It's already formatted.
Multiple sprite support
Change
PHP Code:
// Customization(You do not need to add "sprites/")
new const DEATH_SPRITE[][] =
{
"93skull1" // zp_death_sprite_play 1
}
PHP Code:
// Customization(You do not need to add "sprites/")
new const DEATH_SPRITE[][] =
{
"93skull1", // zp_death_sprite_play 1
"YOUR_SPRITE_NAME" // zp_death_sprite_play 2
}
To change the max sprites can be used:
PHP Code:
// Max sprites
const MAX_SPRITES = 3
Note: You see zp_death_sprite_play 1/2 as a comment.
It will show you how zp_death_sprite_play works.
Ignore it if you wish to use it as random.
Version history
PHP Code:
v1.0 - Initial release
v1.1 - Updated config file with default values
- New CVar - zp_death_sprite_delay
- Same sprite, but better quality - Thanks georgik57
v1.1a - Now you do not need to add .spr
v1.2 - amxmisc is not required anymore
- Now CVars are cached during new round instead of plugin start
- Little fix with executing file
v1.2a - Optimization (Thanks abdul_rehman)
- MSG_BROADCAST to MSG_PVS (Thanks abdul_rehman)
v1.3 - Fixed a code
- Multiple sprite support
- Random or specified sprite via CVar
v1.4 - Change bool to bit
Bugs/Suggestions
Post it! If you've a run time error, please debug it and post it WITH debug. Bugs posted WITHOUT debug will be ignored. Suggestions are welcomed.
Installation
1. Put 93skull1.spr into cstrike/sprites
2. Put .amxx to plugins folder OR compile it locally
3. Add plugin name WITH .amxx into plugins-zplague.ini
4. Put DeathSprite.cfg into your configs folder
I want it for other mods!
It is works for other mods. It only requires AMXModX.
Only zombies version (Requested by Dolph_Ziggler)
CLICK HERE
Note:
- Why it doesn't show the sprite when it's enabled?
Answer: Check CVar zp_death_sprite_play and MAX_SPRITES. It MUST NOT be lesser than 0 and more than the value MAX_SPRITES is assigned to.
Credits
georgik57 - Better quality skull sprite
abdul_rehman - Optimizations