Raised This Month: $ Target: $400
 0% 

[HELP] Repeating a function


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Starman
Junior Member
Join Date: Dec 2013
Old 01-08-2014 , 19:46   Re: [HELP] Repeating a function
Reply With Quote #6

Sorry, I knew I had to give an explanation ... This is the code I'm currently doing ...

I'm making something like a fire aura around the character using an entity type "env_sprite" with a sound created by a friend:

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <engine>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new Fire[] = "sprites/fire.spr"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_forward(FM_CmdStart, "CmdStart")
}

public plugin_precache()
{
    precache_model(Fire)
}

public CmdStart(Client)
{
    if(is_user_alive(Client))
    {
        new Entity = create_entity("env_sprite")
        
        new Float:Origin[3] = {0.0, 5.0, 0.0)
        
        entity_get_vector(Client, EV_VEC_origin, Origin)
        
        entity_set_origin(Entity, Origin)
        
        entity_set_model(Entity, Fire)
        entity_set_int(Entity, EV_INT_rendermode, kRenderTransAdd)
        entity_set_float(Entity, EV_FL_renderamt, 255.0)
        
        entity_set_float(Entity, EV_FL_frame, 12.0)
        entity_set_int(Entity, EV_INT_spawnflags, SF_SPRITE_STARTON)
        
        entity_set_int(Entity, EV_INT_solid, SOLID_BBOX)
        entity_set_int(Entity, EV_INT_movetype, MOVETYPE_FLY)
        entity_set_edict(Entity, EV_ENT_owner, Client)
        
        dllfunc(DLLFunc_Spawn, Ent)
        
        if(!is_user_alive(Client))
        {
            remove_entity(Entity)
        }
    }
}
Probably something this misconceived as a rookie but I'm something like this kind of plugins, however, compiles fine, and the entity is created, but when testing the plugin, many entities are created, and at one point gets slow play, and upload mistake ...

PD: I've already try deleting the condition "is_user_alive" ...
Starman is offline
 



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 10:13.


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