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

Show Death Sprite


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 02-09-2014 , 07:28   Show Death Sprite
Reply With Quote #1

Hey Everyone,

I want to show some sprites when someone kills someone else.
I have this code but the sprites are not showing:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new level[32]

new 
iconstatus

public plugin_precache()
{
    
precache_model("sprites/gga/kill_1.spr")
    
precache_model("sprites/gga/kill_2.spr")
    
precache_model("sprites/gga/kill_3.spr")
    
precache_model("sprites/gga/kill_4.spr")
    
precache_model("sprites/gga/kill_5.spr")
    
precache_model("sprites/gga/kill_6.spr")
    
precache_model("sprites/gga/kill_7.spr")
    
precache_model("sprites/gga/kill_8.spr")
}

public 
plugin_init()
{
    
register_plugin("Death Sprite""1.0""Copyright to prolim123")
    
register_event("DeathMsg","Death","a")
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
    
    
iconstatus get_user_msgid("StatusIcon")
}

public 
Death()
{
    new 
players_ct[32], players_t[32], ictite
    get_players
(players_ct,ict,"ae","CT")   
    
get_players(players_t,ite,"ae","TERRORIST")
    
    new 
attacker read_data(1)
    new 
victim read_data(2)
    new 
name_attacker[32]
    new 
name_victim[32]
    
    
level[attacker] += 1
    level
[victim]= 0
    
    get_user_name
(attackername_attacker31)
    
get_user_name(victimname_victim31)
    
    if((
victim == attacker) || (get_user_team(attacker) == get_user_team(victim)) || !victim || !attacker)
        return 
PLUGIN_CONTINUE
    
    
    
if (level[attacker] >= && level[attacker] <= 8show_sprite(attacker)
    
    return 
PLUGIN_CONTINUE
}

public 
show_sprite(id)
{    
    if(!
is_user_connected(id))
        return 
PLUGIN_HANDLED
        
    
new spr_name[33]
    
    if(
level[id] == 1spr_name "gga/kill_1"
    
else if(level[id] == 2spr_name "gga/kill_2"
    
else if(level[id] == 3spr_name "gga/kill_3"
    
else if(level[id] == 4spr_name "gga/kill_4"
    
else if(level[id] == 5spr_name "gga/kill_5"
    
else if(level[id] == 6spr_name "gga/kill_6"
    
else if(level[id] == 7spr_name "gga/kill_7"
    
else if(level[id] == 8spr_name "gga/kill_8"
    
    
set_task(3.0"hide_sprite"id)
    
    if(!(
pev(id,pev_button) & FL_ONGROUND))
    {    
        
message_begin(MSG_ONE,iconstatus,{0,0,0},id);
        
write_byte(1); // status (0=hide, 1=show, 2=flash)
        
write_string(spr_name); // sprite name
        
message_end();
    }
    
    return 
PLUGIN_CONTINUE
}

public 
hide_sprite(id)
{
    if(!
is_user_connected(id))
        return 
PLUGIN_HANDLED
        
    
new spr_name[33]
    
    if(
level[id] == 1spr_name "gga/kill_1"
    
else if(level[id] == 2spr_name "gga/kill_2"
    
else if(level[id] == 3spr_name "gga/kill_3"
    
else if(level[id] == 4spr_name "gga/kill_4"
    
else if(level[id] == 5spr_name "gga/kill_5"
    
else if(level[id] == 6spr_name "gga/kill_6"
    
else if(level[id] == 7spr_name "gga/kill_7"
    
else if(level[id] == 8spr_name "gga/kill_8"
    
    
if(!(pev(id,pev_button) & FL_ONGROUND))
    {    
        
message_begin(MSG_ONE,iconstatus,{0,0,0},id);
        
write_byte(0); // status (0=hide, 1=show, 2=flash)
        
write_string(spr_name); // sprite name
        
message_end();
    }
    
    return 
PLUGIN_CONTINUE
}

public 
player_spawn(id)
    
level[id] = 
Also i attached the sprites. Please Help.

Thanks in advance,
Oxygen
Attached Files
File Type: zip gga.zip (53.3 KB, 64 views)
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science

Last edited by oxygen935; 02-09-2014 at 07:31.
oxygen935 is offline
Send a message via Skype™ to oxygen935
DavidJr
Senior Member
Join Date: Apr 2012
Old 02-09-2014 , 09:19   Re: Show Death Sprite
Reply With Quote #2

The code looks like the CSO-NST's ones, configure the sprites name in hud.txt
__________________
What are you looking for here?
DavidJr is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 02-09-2014 , 10:59   Re: Show Death Sprite
Reply With Quote #3

Quote:
Originally Posted by DavidJr View Post
The code looks like the CSO-NST's ones, configure the sprites name in hud.txt
Actually, i don't have a lot of experience on sprites, so, could you be more descriptive?
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
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:33.


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