Raised This Month: $ Target: $400
 0% 

change weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-18-2009 , 05:02   change weapons
Reply With Quote #1

is there a tut or somthing like that i can change the weapons? i mean for example give a big explosion to a weapon or change the effects. any thing like weaponmod weapons. like this effect.

i have for first this one, but crash

PHP Code:
#include <amxmodx>
#include <fakemeta>



new P_MODEL[] = "models/p_rpistol.mdl";
new 
V_MODEL[] = "models/v_rpistol.mdl";
new 
W_MODEL[] = "models/w_rpistol.mdl";

new 
RPROCKET_MODEL[] = "models/rpgrocket.mdl"
new RPROCKET_SOUND[] = "weapons/rp_shot1.wav"

new s_RELOAD_1[] = "weapons/rp_reload.wav";

#define RELOAD_TIME 2.0 
#define REFIRE1_RATE 3.0
#define RPROCKET_SPEED   2000
#define RPROCKET_RADIUS   200.0
#define RPROCKET_DAMAGE   150.5
enum
{
       
anim_idle1,
       
anim_idle2,
       
anim_idle3,
       
anim_fire1,
       
anim_fire2,
       
anim_reload,
       
anim_draw,
       
anim_holster,
       
anim_reload2
}
new 
g_wpnid;
new 
g_trailg_explosion;

public 
plugin_precache() 
{
    
precache_model(P_MODEL);
    
precache_model(V_MODEL);
    
precache_model(W_MODEL);
       
    
precache_sound(s_RELOAD_1); 

    
precache_model(RPROCKET_MODEL)
    
precache_sound(RPROCKET_SOUND)

    
g_trail precache_model("sprites/zbeam2.spr")
    
g_explosion precache_model("sprites/gwave1.spr")
}

public 
plugin_init() 
{
        
register_plugin("lol""1""lol");
        
register_forward(FM_Touch"fwd_Touch")

}
stock vec_to_angle(Float:vector[3], Float:output[3])
{
       new 
Float:angles[3]
       
engfunc(EngFunc_VecToAnglesvectorangles)
       
output[0] = angles[0]
       
output[1] = angles[1]
       
output[2] = angles[2]
}
public 
ev_attack1(id)
{
    new 
g_weapon_speed get_user_weapon(id__);
    if(
g_weapon_speed && CSW_SCOUT)
    {

        new 
rocket engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
           
        
set_pev(rocketpev_classname"rp_rocket")
        
engfunc(EngFunc_SetModelrocketRPROCKET_MODEL)
        
set_pev(rocketpev_ownerid)
        
set_pev(rocketpev_movetypeMOVETYPE_FLY)
        
set_pev(rocketpev_solidSOLID_BBOX)
        
set_pev(rocketpev_minsFloat:{-1.0, -1.0, -1.0})
        
set_pev(rocketpev_maxsFloat:{1.01.01.0})
        new 
Float:fStart[3]
     
        
set_pev(rocketpev_originfStart)
        new 
Float:fVel[3]
        
velocity_by_aim(idRPROCKET_SPEEDfVel)      
        
set_pev(rocketpev_velocityfVel)
        new 
Float:fAngles[3]
        
vec_to_angle(fVelfAngles)
        
set_pev(rocketpev_anglesfAngles)
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMFOLLOW)
        
write_short(rocket)
        
write_short(g_trail)
        
write_byte(25)
        
write_byte(5)
        
write_byte(224)
        
write_byte(225)
        
write_byte(255)
        
write_byte(255)
        
message_end()
        
emit_sound(rocketCHAN_WEAPONRPROCKET_SOUND1.0ATTN_NORM0PITCH_NORM);
        return 
PLUGIN_CONTINUE
    
}
}

public 
fwd_Touch(ptrptd)
{
    if(
pev_valid(ptr))
    {
        static 
classname[32];
        
pev(ptrpev_classnameclassname31);
             
        new 
Float:fOrigin[3];
        
pev(ptrpev_originfOrigin);
                 
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYfOrigin0);
        
write_byte(TE_EXPLOSION);
        
engfunc(EngFunc_WriteCoordfOrigin[0]);
        
engfunc(EngFunc_WriteCoordfOrigin[1]);
        
engfunc(EngFunc_WriteCoordfOrigin[2]);
        
write_short(g_explosion);
        
write_byte(30);
        
write_byte(15);
        
write_byte(0);
        
message_end();
    }

</span></span>
__________________

Last edited by One; 06-18-2009 at 07:30.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
stupok
Veteran Member
Join Date: Feb 2006
Old 06-19-2009 , 00:19   Re: change weapons
Reply With Quote #2

Maybe you can read some stuff here: http://forums.space-headed.net/viewforum.php?f=24

Otherwise, if you have a specific question, ask away.
__________________
stupok is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-19-2009 , 05:30   Re: change weapons
Reply With Quote #3

problem : i dont wanna use weaponmod. i just want a power fulll weapon in my mod. od maybe just add any explosion effect to a weapon.nothing more
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-19-2009 , 06:06   Re: change weapons
Reply With Quote #4

What you ask is not very concrete. Just say what you want exactly.
__________________
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-19-2009 , 06:10   Re: change weapons
Reply With Quote #5

an explosion effect by bullet explosion?!
like weapons in weaponmod?! or that what i tried to edit?!
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-19-2009 , 06:33   Re: change weapons
Reply With Quote #6

If you want an explosion effect, see TE_EXPLOSION message. (message_const.inc)
__________________
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 06-20-2009 , 07:16   Re: change weapons
Reply With Quote #7

Quote:
#define TE_EXPLOSION 3 // Additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps
// write_byte(TE_EXPLOSION)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
// write_short(sprite index)
// write_byte(scale in 0.1's)
// write_byte(framerate)
// write_byte(flags)
//
// The Explosion effect has some flags to control performance/aesthetic features:
#define TE_EXPLFLAG_NONE 0 // All flags clear makes default Half-Life explosion
#define TE_EXPLFLAG_NOADDITIVE 1 // Sprite will be drawn opaque (ensure that the sprite you send is a non-additive sprite)
#define TE_EXPLFLAG_NODLIGHTS 2 // Do not render dynamic lights
#define TE_EXPLFLAG_NOSOUND 4 // Do not play client explosion sound
#define TE_EXPLFLAG_NOPARTICLES 8 // Do not draw particles

#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound
// write_byte(TE_TAREXPLOSION)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
ty.but how can i catch the bullets?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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:33.


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