Raised This Month: $ Target: $400
 0% 

how do add sprite?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoOleM
New Member
Join Date: Jun 2011
Old 06-20-2011 , 10:37   how do add sprite?
Reply With Quote #1

Help please, how to add a sprite to play this plugin?
PHP Code:
/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <fakemeta> 
#include <zombieplague> 

#define PLUGIN "Healing skill" 
#define VERSION "1.0" 
#define AUTHOR "teo" 

new cvar_activecvar_timecvar_amount 
new Float:user_time[32
new 
bool:can_heal[32

public 
plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR
    
cvar_active register_cvar("zp_zombie_heal_enable""1"
    
cvar_time register_cvar("zp_zombie_time""5.0"
    
cvar_amount register_cvar("zp_zombie_heal_amount","200.0"
    
register_forward(FM_PlayerPreThink"fm_pthink"


public 
plugin_precache() 

    
precache_sound("zombie_plague/zombi_heal.wav"


public 
fm_pthink(id

    if (!
get_cvar_num("zp_on")) 
        return 
FMRES_IGNORED 
    
if ( zp_get_user_nemesis(id) || zp_get_user_survivor(id)) 
        return 
FMRES_IGNORED 
    
if (!zp_get_user_zombie(id)) 
        return 
FMRES_IGNORED 
    
if (!is_user_alive(id)) 
        return 
FMRES_IGNORED 
    
if (!get_pcvar_num(cvar_active)) 
        return 
FMRES_IGNORED 
    
new button pev(idpev_button
    if (
button IN_MOVELEFT || button IN_MOVERIGHT || button IN_FORWARD || button IN_BACK || button IN_JUMP
        
can_heal[id] = false 
    
if (!(button IN_MOVELEFT || button IN_MOVERIGHT || button IN_FORWARD || button IN_BACK || button IN_JUMP)) 
    { 
        if (!
can_heal[id]) 
        { 
            
can_heal[id] = true 
            user_time
[id] = get_gametime() 
        } 
        if (
can_heal[id]) 
        { 
            new 
Float:current_time get_gametime() 
            if (
current_time user_time[id] >= get_pcvar_float(cvar_time)) 
            { 
                
rehealth(id
                
can_heal[id] = false 
            

        } 
    } 
    return 
FMRES_HANDLED 


public 
rehealth(id

    new 
health pev(idpev_health
    if (
health zp_get_zombie_maxhealth(id)) 
    { 
        if (
health get_pcvar_float(cvar_amount) < zp_get_zombie_maxhealth(id)) 
        { 
            
set_pev(idpev_healthpev(idpev_health) + get_pcvar_float(cvar_amount)) 
            
emit_sound(idCHAN_BODY"zombie_plague/zombi_heal.wav"1ATTN_NORM0PITCH_NORM
        } 
        else 
        { 
            
set_pev(idpev_healthfloat(zp_get_zombie_maxhealth(id))) 
            
emit_sound(idCHAN_BODY"zombie_plague/zombi_heal.wav"1ATTN_NORM0PITCH_NORM
        } 
    } 

GoOleM is offline
johnally
Member
Join Date: May 2011
Location: Mauritius
Old 06-20-2011 , 11:16   Re: how do add sprite?
Reply With Quote #2

Add a sprite offset-y 45 above selected entity!
Global Variables
PHP Code:
#define H_SPRITE     "sprites/spriteA.spr" //sprite path

new g_sprtime;
new 
g_h_blue_spr;
new 
g_plugin_mode;
new 
g_cvarvalue
The function to be called:
PHP Code:
public addsprite(id,level,cid,index)
{
    if(!
cmd_access(id,level,cid,2))  // Cmd access check :)
    
{
        return 
PLUGIN_HANDLED
    
}
    new 
g_cvarvalue get_pcvar_numg_plugin_mode );
    
    
message_beginMSG_ALLSVC_TEMPENTITY );
    
write_byteTE_PLAYERATTACHMENT );
    
write_byteindex );
    
write_coord45 );
    
write_shortg_h_blue_spr ); 
    
write_shortget_pcvar_numg_sprtime ) );
    
message_end();

    return 
PLUGIN_CONTINUE;

PHP Code:
public plugin_precache()
{
    
g_h_blue_spr precache_modelH_SPRITE );
}

public 
plugin_init()
{
    
g_sprtime register_cvar"teamspr_sprite_time""32767" );
    
g_plugin_mode register_cvar"teamspr_mode""1" ); // teammate?

Cheers,
__________________
No allowed!

johnally is offline
GoOleM
New Member
Join Date: Jun 2011
Old 06-20-2011 , 11:28   Re: how do add sprite?
Reply With Quote #3

I can not (
GoOleM is offline
Old 06-20-2011, 12:49
GoOleM
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Old 06-20-2011, 15:57
GoOleM
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
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 23:32.


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