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

Subplugin Submission [ZP] Addon: Death Sprite[v1.4]


Post New Thread Reply   
 
Thread Tools Display Modes
ChickenChaser
Member
Join Date: Aug 2010
Old 07-31-2011 , 05:37   Re: [ZP] Addon: Death Sprite[v1.4]
Reply With Quote #41

nice dude.... thanks
ChickenChaser is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 09-22-2011 , 23:40   Re: [ZP] Addon: Death Sprite[v1.4]
Reply With Quote #42

nice job!
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Old 08-18-2013, 23:32
IamPeresz
This message has been deleted by YamiKaitou. Reason: English Only
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 05-15-2019 , 05:24   Re: [ZP] Addon: Death Sprite[v1.4]
Reply With Quote #43

- Version for biohazard mod ( sprite will appear only when zombie die )
- Sprite and .cfg file download from first post
PHP Code:
#include <amxmodx>
#include <biohazard>

// Plugin Version
new const VERSION[] = "1.4"

// Max sprites
const MAX_SPRITES 3

// Customization(You do not need to add "sprites/")
new const DEATH_SPRITE[][] =
{
    
"93skull1" // zp_death_sprite_play 1
}

// PCVars and caching of CVars
new ToggleBrightnessMessageDelayPlayWhich
new Toggle_CachedBrightness_CachedFloat:Delay_CachedPlayWhich_Cached

// Sprite
new DeathSprite[MAX_SPRITES]

new 
g_bitConnectedPlayers

#define MarkUserConnected(%0)   g_bitConnectedPlayers |= (1 << (%0 & 31))
#define ClearUserConnected(%0)  g_bitConnectedPlayers &= ~(1 << (%0 & 31))
#define IsUserConnected(%0)    g_bitConnectedPlayers & (1 << (%0 & 31))

public plugin_init()
{
    
register_plugin("[ZP] Addon: Death Sprite"VERSION"eXcalibur.007")
    
    
// New Round
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
    
// Death Message event
    
register_event("DeathMsg""event_DeathMsg""a")
    
    
// PCVars
    
Toggle register_cvar("zp_death_sprite""1")
    
Brightness register_cvar("zp_death_sprite_brightness""255")
    
Message register_cvar("zp_death_sprite_message""[R]est.[I]n.[P]eace. - Grim Reaper")
    
Delay register_cvar("zp_death_sprite_delay""1.0")
    
PlayWhich register_cvar("zp_death_sprite_play""0")
}

public 
plugin_precache()
{
    
// Format the directory so we do not need to add "sprites/"
    
static buffer[100], i
    
    
for(0sizeof DEATH_SPRITEi++)
    {
        
formatex(buffer99"sprites/%s.spr"DEATH_SPRITE[i])
        
DeathSprite[i] = precache_model(buffer)
    }
}

public 
plugin_cfg()
{
    
// Cache CVars
    
set_task(0.5"event_new_round")
    
    
// Get configs directory
    
static cfgdir[64]
    
get_localinfo("amxx_configsdir"cfgdir63)
    
    
// Execute custom config file
    
server_cmd("exec %s/DeathSprite.cfg"cfgdir)
    
server_exec()
}

public 
client_putinserver(id)
{
    
// Set variables
    
MarkUserConnected(id)
}

public 
client_disconnect(id)
{
    
// Set variables
    
ClearUserConnected(id)
}

public 
event_new_round()
{
    
// CVars caching
    
Toggle_Cached get_pcvar_num(Toggle)
    
Brightness_Cached get_pcvar_num(Brightness)
    
Delay_Cached get_pcvar_float(Delay)
    
PlayWhich_Cached get_pcvar_num(PlayWhich)
}

public 
event_DeathMsg()
{
    
// If CVar "zp_death_sprite" is 0
    
if(!Toggle_Cached)
        return 
PLUGIN_CONTINUE
    
    
// Victim's index
    
static victimvictim read_data(2)
    
    
// Valid victim & connected
    
if(victim && IsUserConnected(victim) && is_user_zombie(victim))
    {
        static 
string[192]
        
get_pcvar_string(Messagestring191)
        
        
// Empty spaces = Disables print
        
if(string[0])
            
client_print(victimprint_chat"%s"string)
        
        
// Invalid CVar value
        
if(PlayWhich_Cached MAX_SPRITES || PlayWhich_Cached 0)
        {
            
server_print("Please check zp_death_sprite_play and MAX_SPRITES constant. It must not be more than %i and not less than 0."MAX_SPRITES)
            return 
PLUGIN_CONTINUE
        
}
        
        
set_task(Delay_Cached"show_sprite"victim)
    }
    return 
PLUGIN_CONTINUE
}

public 
show_sprite(id)
{
    if(
IsUserConnected(id))
    {
        static 
sprite
        
        
// Valid CVar value
        
if(PlayWhich_Cached == 0)
            
sprite random_num(0sizeof DEATH_SPRITE 1)
        else
            
sprite PlayWhich_Cached 1
        
        
// Get user's origin
        
static origin[3]
        
get_user_origin(idorigin)
        
        
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
        
write_byte(TE_SPRITE)
        
write_coord(origin[0])
        
write_coord(origin[1])
        
write_coord(origin[2])
        
write_short(DeathSprite[sprite])
        
write_byte(15)
        
write_byte(Brightness_Cached)
        
message_end()
    }
    return 
PLUGIN_CONTINUE

__________________
Check my original plugins for cs 1.6 and subscribe on channel
Look at the video bellow to see zombie frost grenade

https://youtu.be/j0zspNfN-AM?si=_1IiGPETN-GQY9Ua

Look at the video below to see Zombie blind grenade

https://youtu.be/ORC7ZmoaipQ?si=QC8Bul96QGitUwX4

Last edited by Krtola; 05-15-2019 at 05:25.
Krtola is offline
Send a message via Skype™ to Krtola
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 21:11.


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