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

Bullet_fx


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-03-2012 , 18:32   Re: Bullet_fx
Reply With Quote #11

create_bullet() makes a bullet entity.
You should hook when that bullet touches something, and then remove it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Thesmokekoke
Member
Join Date: Dec 2011
Old 01-03-2012 , 18:53   Re: Bullet_fx
Reply With Quote #12

i am newbie with scripting can you make the source i will be very thankfull!
Thesmokekoke is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-03-2012 , 22:45   Re: Bullet_fx
Reply With Quote #13

Try this:
PHP Code:
/* Plugin generated by AMXX-Studio */
/* credit : Knekters Bulelt Time*/

#include <amxmodx>
#include <engine>
#include <hamsandwich>

#define PLUGIN "Bullet Effects"
#define VERSION "0.2"
#define AUTHOR "The Specialist"

#define NORMALSPEED   800
#define SNIPERSPEED   1100

new WeaponUsed[33];
new 
AmmoUsed[33];
new 
g_Switch;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
g_Switch register_cvar("bfx_switch","1");
    
register_event("CurWeapon""Weapon_Event","be""1=1""3>0");
    
RegisterHam(Ham_Touch,"info_target","FwdTouch");
}
public 
Weapon_Event(id)
{    
    if(
get_pcvar_num(g_Switch)==0)
    {
        return 
PLUGIN_HANDLED;
    }else{    
        new 
Weapon read_data(2);
        new 
Clip read_data(3);
    
        if(
WeaponUsed[id] == 0)
        
WeaponUsed[id] = Weapon;
    
        if((
AmmoUsed[id] > Clip) && (WeaponUsed[id] == Weapon) && Weapon != && Weapon != && Weapon != &&  Weapon != 25
        {
            
create_bullet(idWeapon);
        }
        
WeaponUsed[id] = Weapon;
        
AmmoUsed[id] = Clip;
        return 
0;
    }
    return 
PLUGIN_HANDLED;
}
public 
FwdTouch(bulletent) {
    if(!
is_valid_ent(bullet)) return;
    
    new 
classname[32];
    
entity_get_string(bulletEV_SZ_classnameclassnamecharsmax(classname));
    
    if(
equal(classname"BulletX")) {
        
remove_entity(bullet);
    }
}
public 
create_bullet(idWeapon)
 {
    new 
Bullets create_entity("info_target");
    if(
Bullets  0
    {
        new 
g_Weapon[33];
        new 
Float:Angle[3];
        new 
Float:Origin[3];
        new 
Float:AimVelocity[3];
        new 
Float:MinBox[3] = {-1.0, -1.0, -1.0};
        new 
Float:MaxBox[3] = {1.01.01.0};
        
entity_get_vector(idEV_VEC_originOrigin);
        
Origin[2] += 12.0;
        
entity_set_string(BulletsEV_SZ_classname"BulletX");
        
entity_set_model(Bullets"models/shell.mdl");
        
get_weaponname(Weapong_Weapon32);
        
entity_set_string(BulletsEV_SZ_targetnameg_Weapon);
        
entity_get_vector(idEV_VEC_v_angleAngle);
        
entity_set_vector(BulletsEV_VEC_minsMinBox);
        
entity_set_vector(BulletsEV_VEC_maxsMaxBox);
        
entity_set_origin(BulletsOrigin);
        
entity_set_vector(BulletsEV_VEC_anglesAngle);
        
entity_set_vector(BulletsEV_VEC_v_angleAngle);
        
entity_set_int(BulletsEV_INT_effects2);
        
entity_set_int(BulletsEV_INT_solid2);
        
entity_set_int(BulletsEV_INT_movetype5);
        
entity_set_edict(BulletsEV_ENT_ownerid);
        
        if(
Weapon != && Weapon != 13 && Weapon != 18 && Weapon != 24)
        {            
            
VelocityByAim(idNORMALSPEEDAimVelocity);
        } else {
            
VelocityByAim(idSNIPERSPEEDAimVelocity);
        }
        
entity_set_vector(BulletsEV_VEC_velocityAimVelocity);
        if( 
get_user_teamid ) == )
        {
            
set_rendering(BulletskRenderFxGlowShell 255,0,0,kRenderNormal,100);
        }else{
            
set_rendering(BulletskRenderFxGlowShell 0,0,255,kRenderNormal,100);
        }
    }
    return 
0;
}
public 
plugin_precache()
{
    
precache_model("models/shell.mdl");

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 01-03-2012 at 22:45.
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-04-2012 , 00:21   Re: Bullet_fx
Reply With Quote #14

I think -1 -1 -1 1 1 1 is default size for info_target, at least if you spawn it, so i'm not sure any touch will be triggered in that case.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Thesmokekoke
Member
Join Date: Dec 2011
Old 01-04-2012 , 16:10   Re: Bullet_fx
Reply With Quote #15

Exolent

Thanks very much!

Last edited by Thesmokekoke; 01-04-2012 at 16:11.
Thesmokekoke is offline
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 15:45.


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