AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZP] Addon: Death Sprite[v1.4] (https://forums.alliedmods.net/showthread.php?t=141083)

Excalibur.007 10-19-2010 10:16

[ZP] Addon: Death Sprite[v1.4]
 
10 Attachment(s)
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


:arrow:

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 

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 spritebut 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

georgik57 10-19-2010 10:37

Re: [ZP] Addon: Death Sprite[v1.0]
 
http://forums.alliedmods.net/showthr...53#post1283853
also add delay for this, so it will appear x seconds after the death msg with float pls
thanks

ollegicch 10-19-2010 11:45

Re: [ZP] Addon: Death Sprite[v1.0]
 
GJ!)

Excalibur.007 10-19-2010 19:24

Re: [ZP] Addon: Death Sprite[v1.1]
 
Plugin updated. Please use the new one. Remember to redownload the sprites as new sprite(The design is still the same but it has better quality)
Sprites credit to georgik57. New CVar has been added by request. If someone has a suitable sound effect for that. I would be greatly appreciated.

mrkun 10-20-2010 00:18

Re: [ZP] Addon: Death Sprite[v1.1a]
 
some screenshot please :)

Excalibur.007 10-20-2010 00:55

Re: [ZP] Addon: Death Sprite[v1.1a]
 
Doesn't need screen shots :|. Just use SPRView and view the sprite.

georgik57 10-20-2010 07:25

Re: [ZP] Addon: Death Sprite[v1.1a]
 
thanks for adding my req
this pwns now

Excalibur.007 11-01-2010 10:01

Re: [ZP] Addon: Death Sprite[v1.2]
 
BUMPPPIIEEE

PHP Code:

v1.2 amxmisc is not required anymore
     
Now CVars are cached during new round instead of plugin start
     
Little fix with executing file 


abdul-rehman 11-01-2010 10:15

Re: [ZP] Addon: Death Sprite[v1.2]
 
HY man i read youre plugin and found some effeciency tricks which you can implement
1- I think caching cvars is not a good idea for this one bcoz death event is not called every 0.01 seconds or some thing as low

2- U should use static variables since they are more faster

3- U should cache is_user_connected instead since it is more effecient
Code:
public client_putinserver( id ) g_bIsConnected[ id ] = true
Code:
public client_disconnect( id ) g_bIsConnected[ id ] = false

4- You can simple use this:
Code:
        if(string[0])         {             client_print(victim, print_chat, "%s", string)         }
Instead of an equali since it will be more effecient ! :up:

tempito 11-01-2010 11:43

Re: [ZP] Addon: Death Sprite[v1.2]
 
screenshots please.


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

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