Raised This Month: $ Target: $400
 0% 

Anyone familiar with WeaponMod ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-02-2008 , 00:11   Anyone familiar with WeaponMod ?
Reply With Quote #1

I installed WeaponMod on my server the other day and now I've added a few addon weapons, but some of the weapon don't shoot "through" the walls or break "breakable things such as vent openings.. what can I do to change this ?

Like this weapon here, a "Laser", also it seems to have unlimited ammo, the 2nd ammo doesn't even get takena way from, once the first 100 drains to 0, it just couns back up to 100 and then down again .. can these features be changed?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <weaponmod>
new const PLUGIN[] = "WPN Laser"
new const VERSION[] = "0.7"
new const AUTHOR[] = "DevconeS/World Crafter"
new WPN_NAME[] = "Concentrated Light Amplifier"
new WPN_SHORT[] = "lasergun"
new P_MODEL[] = "models/p_laser.mdl"
new V_MODEL[] = "models/v_laser.mdl"
new W_MODEL[] = "models/w_laser.mdl"
new SOUND_RUN[] = "weapons/laser_fire.wav"
#define LOAD_UP_TIME 0.01
#define SHUT_DOWN_TIME 0.1
#define SHOOT_LENGTH 2.0
// Sequences
enum
{
 
anim_idle,
 
anim_fire,
 
anim_reload,
 
anim_draw
}
// Types
enum
{
 
act_none,
 
act_load_up,
 
act_run
}
new 
g_wpnid
new Float:g_lastShot[33]
new 
Float:g_nextSound[33]
new 
g_plAction[33]
new 
g_MaxPlayers
new laser
new blood
new bloodspray
public plugin_precache() {
 
precache_model(P_MODEL)
 
precache_model(V_MODEL)
 
precache_model(W_MODEL)
 
precache_sound(SOUND_RUN)
 
laser precache_model("sprites/laserbeam.spr")
 
blood precache_model("sprites/blood.spr")
 
bloodspray precache_model("sprites/bloodspray.spr")
}
public 
plugin_init() {
 
register_plugin(PLUGIN,VERSION,AUTHOR)
 
 
register_forward(FM_Think,"fwd_Think")
 
register_forward(FM_Touch,"fwd_Touch")
 
register_forward(FM_StartFrame,"fwd_StartFrame")
 
 
g_MaxPlayers get_maxplayers()
 
 
create_weapon()
}
create_weapon() {
 new 
wpnid wpn_register_weapon(WPN_NAME,WPN_SHORT)
 if(
wpnid == -1) return PLUGIN_CONTINUE
 
 wpn_set_string
(wpnid,wpn_viewmodel,V_MODEL)
 
wpn_set_string(wpnid,wpn_weaponmodel,P_MODEL)
 
wpn_set_string(wpnid,wpn_worldmodel,W_MODEL)
 
 
wpn_register_event(wpnid,event_attack1,"ev_attack1")
 
wpn_register_event(wpnid,event_reload,"ev_reload")
 
wpn_register_event(wpnid,event_draw,"ev_draw")
 
 
wpn_set_float(wpnid,wpn_refire_rate1,0.025)
 
wpn_set_float(wpnid,wpn_reload_time,2.3)
 
wpn_set_float(wpnid,wpn_recoil1,1.0)
 
wpn_set_float(wpnid,wpn_run_speed,250.0)
 
 
wpn_set_integer(wpnid,wpn_ammo1,125// Here are the ammo for the weapon
 
wpn_set_integer(wpnid,wpn_ammo2,250// but when this amount it used up it just reloads, or starts counting up
 
wpn_set_integer(wpnid,wpn_bullets_per_shot1,1)
 
wpn_set_integer(wpnid,wpn_bullets_per_shot2,0)
 
wpn_set_integer(wpnid,wpn_cost,7000)
 
 
g_wpnid wpnid
 
return PLUGIN_CONTINUE
}
public 
ev_reload(id)
 
wpn_playanim(id,anim_reload)
public 
ev_draw(id)
 
wpn_playanim(id,anim_draw)
public 
ev_attack1(id) {
 
//wpn_playanim(id,anim_fire)
 
new Float:gtime get_gametime()
 
g_lastShot[id] = gtime
 
 
if(g_nextSound[id] <= gtime) {
  new 
usrwpn wpn_has_weapon(id,g_wpnid)
  switch(
g_plAction[id]) {
   case 
act_none: {
    
g_nextSound[id] = gtime+LOAD_UP_TIME
    g_plAction
[id] = act_load_up
 
    
// No flame was shot, so don't decrease ammo :)
    
wpn_set_userinfo(id,usr_wpn_ammo1,usrwpn,wpn_get_userinfo(id,usr_wpn_ammo1,usrwpn)+1)
    return 
PLUGIN_CONTINUE
   
}
   case 
act_load_up: {
    
emit_sound(id,CHAN_WEAPON,SOUND_RUN,0.8,ATTN_NORM,0,PITCH_NORM)
    
wpn_playanim(id,anim_fire)
    
g_nextSound[id] = gtime
    g_plAction
[id] = act_run
 
    
// No flame was shot, so don't decrease ammo :)
    
wpn_set_userinfo(id,usr_wpn_ammo1,usrwpn,wpn_get_userinfo(id,usr_wpn_ammo1,usrwpn)+1)
    return 
PLUGIN_CONTINUE
   
}
  }
 }
 
 new 
aimvec[3]
 
get_user_origin(id,aimvec,3)
 
 
message_beginMSG_BROADCAST,SVC_TEMPENTITY)
 
write_byte (TE_BEAMENTPOINT)     //TE_BEAMENTPOINTS 0
 
write_short(id 0x1000)
 
write_coord(aimvec[0])
 
write_coord(aimvec[1])
 
write_coord(aimvec[2])
 
write_short(laser)
 
write_byte// framestart
 
write_byte// framerate
 
write_byte// life
 
write_byte10 // width
 
write_byte// noise
 
write_byte250 // r, g, b
 
write_byte// r, g, b
 
write_byte// r, g, b
 
write_byte200 // brightness
 
write_byte200 // speed
 
message_end()
 
 
message_beginMSG_PVSSVC_TEMPENTITY)
 
write_byte)
 
write_coordaimvec[0] )
 
write_coordaimvec[1] )
 
write_coordaimvec[2] )
 
message_end()
 
 
 new 
FFOn get_cvar_num("mp_friendlyfire")
 new 
tid,tbody
 
 get_user_aiming
(id,tidtbody)
 if( 
is_user_alive(tid) && ( FFOn || get_user_team(id) != get_user_team(tid) ) ) {
  
wpn_damage_user(g_wpnid,tid,id,0,random_num(7,10),DMG_ENERGYBEAM)
  
message_begin(MSG_BROADCAST,SVC_TEMPENTITY
  
write_byte(TE_BLOODSPRITE)
  
write_coord(aimvec[0]) 
  
write_coord(aimvec[1]) 
  
write_coord(aimvec[2]) 
  
write_short(bloodspray)
  
write_short(blood)
  
write_byte(70)
  
write_byte(random_num(7,10))
  
message_end()
 }
 
 new 
decal random_num(41,44)
 
 if (
tid){
  
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  
write_byte(TE_DECAL)
  
write_coord(aimvec[0])
  
write_coord(aimvec[1])
  
write_coord(aimvec[2])
  
write_byte(decal)
  
write_short(tid)
  
message_end()
 }else{ 
  
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  
write_byte(TE_WORLDDECAL)
  
write_coord(aimvec[0])
  
write_coord(aimvec[1])
  
write_coord(aimvec[2])
  
write_byte(decal)
  
message_end()
 }
 
 return 
PLUGIN_CONTINUE
}
public 
fwd_StartFrame() {
 static 
Float:gtime
 
static pwpn
 gtime 
get_gametime()
 
 for(new 
id 1id g_MaxPlayersid++) {
  if(
g_plAction[id] != act_none) {
   
pwpn wpn_has_weapon(id,g_wpnid)
   if((!(
pev(id,pev_button) & IN_ATTACK) && g_lastShot[id]+0.2 gtime)  || (pwpn == -1)) {
    
emit_sound(id,CHAN_WEAPON,SOUND_RUN,0.8,ATTN_NORM,SND_STOP,PITCH_NORM)
    
wpn_playanim(id,anim_idle)
    
g_plAction[id] = act_none
   
}
  }
 }

Is it possible to add "Same team colors" on the trail to this RPG Weapon for WeaponMod ?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <weaponmod>
new PLUGIN[] = "WPN RPG"
new VERSION[] = "0.1"
new AUTHOR[] = "DevconeS(Edited by Humming Bird)"
new WPN_NAME[] = "RPG"
new WPN_SHORT[] = "rpg"
new P_MODEL[] = "models/p_rpg.mdl"
new V_MODEL[] = "models/v_rpg.mdl"
new W_MODEL[] = "models/w_rpg.mdl"
new ROCKET_MDL[] = "models/rpgrocket.mdl"
new ROCKET_SOUND[] = "weapons/rocketfire1.wav"
#define ROCKET_SPEED 1400
#define ROCKET_RADIUS 270.0
#define ROCKET_DAMAGE 200.0
// Sequences
enum
{
 
anim_idle1,
 
anim_fidget1,
 
anim_altfireon,
 
anim_altfirecycle,
 
anim_altfireoff,
 
anim_fire1,
 
anim_fire2,
 
anim_fire3,
 
anim_fire4,
 
anim_draw,
 
anim_holster
}
new 
g_wpnid
new g_trail,g_explosion
public plugin_precache() {
 
precache_model(P_MODEL)
 
precache_model(V_MODEL)
 
precache_model(W_MODEL)
 
 
precache_model(ROCKET_MDL)
 
precache_sound(ROCKET_SOUND)
 
 
g_trail precache_model("sprites/smoke.spr")
 
g_explosion precache_model("sprites/zerogxplode.spr")
}
public 
plugin_init() {
 
register_plugin(PLUGIN,VERSION,AUTHOR)
 
 
register_forward(FM_Touch,"fwd_Touch")
 
 
create_weapon()
}
create_weapon() {
 new 
wpnid wpn_register_weapon(WPN_NAME,WPN_SHORT)
 if(
wpnid == -1) return PLUGIN_CONTINUE
 
 wpn_set_string
(wpnid,wpn_viewmodel,V_MODEL)
 
wpn_set_string(wpnid,wpn_weaponmodel,P_MODEL)
 
wpn_set_string(wpnid,wpn_worldmodel,W_MODEL)
 
 
wpn_register_event(wpnid,event_attack1,"ev_attack1")
 
wpn_register_event(wpnid,event_draw,"ev_draw")
 
 
wpn_set_float(wpnid,wpn_refire_rate1,1.0)
 
wpn_set_float(wpnid,wpn_reload_time,2.0)
 
wpn_set_float(wpnid,wpn_recoil1,4.0)
 
wpn_set_float(wpnid,wpn_run_speed,210.0)
 
 
wpn_set_integer(wpnid,wpn_ammo1,5)
 
wpn_set_integer(wpnid,wpn_ammo2,0)
 
wpn_set_integer(wpnid,wpn_bullets_per_shot1,1)
 
wpn_set_integer(wpnid,wpn_cost,6000)
 
 
g_wpnid wpnid
 
return PLUGIN_CONTINUE
}
// vector_to_angle port
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) {
 
wpn_playanim(id,random_num(anim_fire3,anim_fire4))
 
 new 
rocket engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))
 if(!
rocket) return PLUGIN_CONTINUE
 
 
// Strings
 
set_pev(rocket,pev_classname,"wpn_rpg")
 
engfunc(EngFunc_SetModel,rocket,ROCKET_MDL)
 
 
// Integer
 
set_pev(rocket,pev_owner,id)
 
set_pev(rocket,pev_movetype,MOVETYPE_FLY)
 
set_pev(rocket,pev_solid,SOLID_BBOX)
 
 
// Floats
 
set_pev(rocket,pev_mins,Float:{-1.0,-1.0,-1.0})
 
set_pev(rocket,pev_maxs,Float:{1.0,1.0,1.0})
 
 new 
Float:fStart[3]
 
wpn_projectile_startpos(id,40,0,0,fStart)
 
set_pev(rocket,pev_origin,fStart)
 
 new 
Float:fVel[3]
 
velocity_by_aim(id,ROCKET_SPEED,fVel)  
 
set_pev(rocket,pev_velocity,fVel)
 
 new 
Float:fAngles[3]
 
vec_to_angle(fVel,fAngles)
 
set_pev(rocket,pev_angles,fAngles)
 
 
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(224)
 
write_byte(255)
 
write_byte(255)
 
message_end()
 
 
emit_sound(rocketCHAN_WEAPONROCKET_SOUND1.0ATTN_NORM0PITCH_NORM)
 
 return 
PLUGIN_CONTINUE
}
public 
ev_draw(id)
 
wpn_playanim(id,anim_draw)
public 
fwd_Touch(ptrptd) {
 if(
pev_valid(ptr)) {
  new 
classname[32]
  
pev(ptr,pev_classname,classname,31)
 
  if(
equal(classname,"wpn_rpg")) {
   new 
Float:fOrigin[3],iOrigin[3]
   
pev(ptr,pev_origin,fOrigin)
 
   
iOrigin[0] = floatround(fOrigin[0])
   
iOrigin[1] = floatround(fOrigin[1])
   
iOrigin[2] = floatround(fOrigin[2])
 
   
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,iOrigin)
   
write_byte(TE_EXPLOSION)
   
write_coord(iOrigin[0])
   
write_coord(iOrigin[1])
   
write_coord(iOrigin[2])
   
write_short(g_explosion)
   
write_byte(30)
   
write_byte(15)
   
write_byte(0)
   
message_end()
 
   new 
attacker pev(ptr,pev_owner)
   
wpn_radius_damage(g_wpnid,attacker,ptr,ROCKET_RADIUS,ROCKET_DAMAGE,DMG_BLAST// This is line 178
   
if(pev_valid(ptd)) {
    
pev(ptd,pev_classname,classname,31)
 
    if(
equal(classname,"func_breakable"))
     
dllfunc(DLLFunc_Use,ptd,ptr)
   }
   
set_pev(ptr,pev_flags,FL_KILLME)
  }
 } 
As seen in this one,
http://forums.alliedmods.net/showthread.php?p=178286
__________________
+Karma is appreciated! |Be PROUD, leave your name!

Last edited by KingCommentor; 08-02-2008 at 00:31.
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-02-2008 , 04:56   Re: Anyone familiar with WeaponMod ?
Reply With Quote #2

Quote:
but some of the weapon don't shoot "through" the walls or break "breakable things such as vent openings.. what can I do to change this ?
Ask the author to add it in the right forum ( I've already said that in MP )
If you have requests or problems with a specific weapon, ask in the right thread. ( http://forums.space-headed.net/viewforum.php?f=25 )


Quote:
Is it possible to add "Same team colors" on the trail to this RPG Weapon for WeaponMod ?
The color is already the same for both team. +attack and +attack2 have just a different color.
__________________
Arkshine is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-02-2008 , 16:57   Re: Anyone familiar with WeaponMod ?
Reply With Quote #3

Not the one I am using, wpn_rpg .. I'm not sure about the wpn_rocketlauncher that comes standard with the weaponmod.zip download because that one sucks.

I went to the weapons forum on that link and got a better one but the grenade launcher trail for both teams is just white, and +attack2 does nothing.
__________________
+Karma is appreciated! |Be PROUD, leave your name!
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-02-2008 , 17:13   Re: Anyone familiar with WeaponMod ?
Reply With Quote #4

Quote:
one sucks.
This version is better. ( +attack = aim / +attack2 = remote control ). Though, it would be more better to add the mode ( direct shoot ) from wpn_rpg. ( basicaly like the RPG in HL )

Quote:
but the grenade launcher trail for both teams is just white
Sorry I'm a bit confused. What do you want ? Different color by team ? Because wpn_rpg, like you said, has a while trail for both team.
__________________
Arkshine is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-02-2008 , 19:18   Re: Anyone familiar with WeaponMod ?
Reply With Quote #5

Well the wpn_rocketlauncher does have the user controlled version but its actually not very good because you still are looking like your holding your bazooka, on the link to the amxx version of the bazooka when you go to user-guided mode you actually "are the bazooka" if you understand what I mean .. you no longer are the player, until the bazooka explodes.

But what I'm saying about the trails .. you know what Grenade Trails are?
When you throw the grenade depending on your team there is a trail behind the genade in the air either red or blue. Well the Bazooka I have linked you to above has the same thing but for when you shoot the bazooka instead of the trail being white its either red or blue depending on your team.


And how hard do you think it would be to allow those guns to shoot through walls? Because The authors of most of the weapons for WeaponMod haven't posted in over a year .. well to this specific wpn_laser anyways. If its not too much trouble I was wondering if someone here could add that?
__________________
+Karma is appreciated! |Be PROUD, leave your name!

Last edited by KingCommentor; 08-02-2008 at 19:31.
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-02-2008 , 19:40   Re: Anyone familiar with WeaponMod ?
Reply With Quote #6

Quote:
Well the wpn_rocketlauncher does have the user controlled version but its actually not very good because you still are looking like your holding your bazooka, on the link to the amxx version of the bazooka when you go to user-guided mode you actually "are the bazooka" if you understand what I mean .. you no longer are the player, until the bazooka explodes.
That's fun -_-. All players like theses modes. Mainly +attack2. But I will modify the plugin to integrate the mode 'direct shoot' like in HL.


Quote:
But what I'm saying about the trails .. you know what Grenade Trails are?
When you throw the grenade depending on your team there is a trail behind the genade in the air either red or blue. Well the Bazooka I have linked you to above has the same thing but for when you shoot the bazooka instead of the trail being white its either red or blue depending on your team.
As I've already said, there are no differents color by team in wpn_rpg.

As you see, there are just ( RGB ) :

Code:
write_byte(224)
write_byte(224)
write_byte(255)
255 = white, the color is mainly white.

So the problem is not this plugin. Though, except a conflict with another plugin, I don't see why it happens.
__________________

Last edited by Arkshine; 08-02-2008 at 19:45.
Arkshine is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-02-2008 , 19:53   Re: Anyone familiar with WeaponMod ?
Reply With Quote #7

You don't understand what I'm asking, it doesnt matter anyways .. but I got these other 2 guns earlier I'll add the code I'm not sure if the author still supports he hasn't posted on the thread in some time .. All I want to do it change the speed .. at the top where it says:
# define speed 999.5 -- I changed this to #define speed 250

But now when players buy this gun they can not move at all .. so how can I go about lowering the speed on this weapon.
If you want to know why I am doing this is because I run HookMod on my server which the speed it set to 3, so this takes that 999.5 speed and multiplies it x3 so now all my players are slinging around the map at a rate of about 3000speed ..

PHP Code:
#include <amxmodx>
#include <engine>
#include <weaponmod>
// Personal Preference
#pragma semicolon 1
#define PLUGIN "Half Life 9mm"
#define VERSION "0.2.0"
#define AUTHOR "Darkness"
// Weapon information
new WPN_NAME[] = "9mmPistol";
new 
WPN_SHORT[] = "9mm";
// Model information
new P_MODEL[] = "models/p_9mmhandgun.mdl";
new 
V_MODEL[] = "models/v_9mmhandgun.mdl";
new 
W_MODEL[] = "models/p_9mmhandgun.mdl";
// Sound information
new s_RELOAD_1[] = "items/9mmclip1.wav";
new 
s_RELOAD_2[] = "items/9mmclip2.wav";
new 
s_FIRE[] = "weapons/pl_gun3.wav";
// Weapon information
#define RELOAD_TIME 2.0
#define RECOIL1 1.5
#define REFIRE1_RATE 0.35
#define REFIRE2_RATE 0.18
#define RUN_SPEED 999.5
#define CLIP_AMMO 18
#define TOTAL_AMMO 180
#define WPN_COST 0
#define BULLET_PER_SHOT 1
#define BULLET_PER_SHOT2 1
#define DMG_PER_BULLET_MAX 10
#define DMG_PER_BULLET_MIN 10
#define DMG_PER_BULLET_MIN2 8
#define DMG_PER_BULLET_MAX2 8
// Sequences
enum
{
 
anim_idle1,
 
anim_idle2,
 
anim_idle3,
 
anim_shoot,
 
anim_shoot_empty,
 
anim_reload,
 
anim_reload_noshot,
 
anim_draw,
 
anim_holster,
 
anim_add_silencer
 
 
}
// Variables
new g_wpnid;
public 
plugin_precache() {
 
precache_model(P_MODEL);
 
precache_model(V_MODEL);
 
precache_model(W_MODEL);
 
 
precache_sound(s_RELOAD_1);
 
precache_sound(s_RELOAD_2);
 
precache_sound(s_FIRE);
}
public 
plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR);
 
 
create_weapon();
 
}
create_weapon() {
 new 
wpnid wpn_register_weapon(WPN_NAME,WPN_SHORT);
 if(
wpnid == -1) {
  return 
PLUGIN_CONTINUE;
 }
 
 
wpn_set_string(wpnidwpn_viewmodelV_MODEL);
 
wpn_set_string(wpnidwpn_weaponmodelP_MODEL);
 
wpn_set_string(wpnidwpn_worldmodelW_MODEL);
 
 
wpn_register_event(wpnidevent_attack1"ev_attack1");
 
wpn_register_event(wpnidevent_attack2"ev_attack2");
 
wpn_register_event(wpnidevent_draw"ev_draw");
 
wpn_register_event(wpnidevent_reload"ev_reload");
 
 
wpn_set_float(wpnidwpn_refire_rate1REFIRE1_RATE);
 
wpn_set_float(wpnidwpn_refire_rate2REFIRE2_RATE);
 
wpn_set_float(wpnidwpn_reload_timeRELOAD_TIME);
 
wpn_set_float(wpnidwpn_recoil1RECOIL1);
 
wpn_set_float(wpnidwpn_run_speedRUN_SPEED);
 
 
wpn_set_integer(wpnidwpn_ammo1CLIP_AMMO);
 
wpn_set_integer(wpnidwpn_ammo2TOTAL_AMMO);
 
wpn_set_integer(wpnidwpn_bullets_per_shot1BULLET_PER_SHOT);
 
wpn_set_integer(wpnidwpn_bullets_per_shot2BULLET_PER_SHOT2);
 
wpn_set_integer(wpnidwpn_costWPN_COST);
 
 
g_wpnid wpnid;
 return 
PLUGIN_CONTINUE;
}
public 
ev_attack1(id) {
 
wpn_playanim(id,anim_shoot );
 
emit_sound(idCHAN_WEAPONs_FIRE1.0ATTN_NORM0PITCH_NORM);
 
wpn_bullet_shot(g_wpnidid0random_num(DMG_PER_BULLET_MINDMG_PER_BULLET_MAX));
 
 return 
PLUGIN_CONTINUE;
}
public 
ev_attack2(id) {
 
wpn_playanim(id,anim_shoot );
 
emit_sound(idCHAN_WEAPONs_FIRE1.0ATTN_NORM0PITCH_NORM);
 
wpn_bullet_shot(g_wpnidid0random_num(DMG_PER_BULLET_MIN2DMG_PER_BULLET_MAX2));
 
 return 
PLUGIN_CONTINUE;
}
public 
ev_draw(id) {
 
wpn_playanim(idanim_draw);
 
 return 
PLUGIN_CONTINUE;
}
public 
ev_reload(id) {
 
wpn_playanim(idanim_reload);
 return 
PLUGIN_CONTINUE;

And

PHP Code:
#include <amxmodx>
#include <engine>
#include <weaponmod>
// Personal Preference
#pragma semicolon 1
#define PLUGIN "Half Life 9mm"
#define VERSION "0.2.0"
#define AUTHOR "Darkness"
// Weapon information
new WPN_NAME[] = "357Magnum";
new 
WPN_SHORT[] = "357";
// Model information
new P_MODEL[] = "models/p_357.mdl";
new 
V_MODEL[] = "models/v_357.mdl";
new 
W_MODEL[] = "models/w_357.mdl";
// Sound information
new s_RELOAD_1[] = "weapons/357_reload1.wav";
new 
s_FIRE_1[] = "weapons/357_shot1.wav";
new 
s_FIRE_2[] = "weapons/357_shot2.wav";
// Weapon information
#define RELOAD_TIME 2.0
#define RECOIL1 1.5
#define REFIRE1_RATE 0.80
#define RUN_SPEED 999.5
#define CLIP_AMMO 9
#define TOTAL_AMMO 45
#define WPN_COST 0
#define BULLET_PER_SHOT 1
#define DMG_PER_BULLET_MAX 10
#define DMG_PER_BULLET_MIN 10
// Sequences
enum
{
anim_idle1
anim_fidget1,
anim_fire1,  
anim_reload
anim_holster,
anim_draw,
anim_idle2,
anim_idle3 
}
// Variables
new g_wpnid;
public 
plugin_precache() {
 
precache_model(P_MODEL);
 
precache_model(V_MODEL);
 
precache_model(W_MODEL);
 
 
precache_sound(s_RELOAD_1);
 
precache_sound(s_FIRE_1);
 
precache_sound(s_FIRE_2);
}
public 
plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR);
 
 
create_weapon();
 
}
create_weapon() {
 new 
wpnid wpn_register_weapon(WPN_NAME,WPN_SHORT);
 if(
wpnid == -1) {
  return 
PLUGIN_CONTINUE;
 }
 
 
wpn_set_string(wpnidwpn_viewmodelV_MODEL);
 
wpn_set_string(wpnidwpn_weaponmodelP_MODEL);
 
wpn_set_string(wpnidwpn_worldmodelW_MODEL);
 
 
wpn_register_event(wpnidevent_attack1"ev_attack1");
 
wpn_register_event(wpnidevent_attack2"ev_attack2");
 
wpn_register_event(wpnidevent_draw"ev_draw");
 
wpn_register_event(wpnidevent_reload"ev_reload");
 
 
wpn_set_float(wpnidwpn_refire_rate1REFIRE1_RATE);
 
wpn_set_float(wpnidwpn_reload_timeRELOAD_TIME);
 
wpn_set_float(wpnidwpn_recoil1RECOIL1);
 
wpn_set_float(wpnidwpn_run_speedRUN_SPEED);
 
 
wpn_set_integer(wpnidwpn_ammo1CLIP_AMMO);
 
wpn_set_integer(wpnidwpn_ammo2TOTAL_AMMO);
 
wpn_set_integer(wpnidwpn_bullets_per_shot1BULLET_PER_SHOT);
 
wpn_set_integer(wpnidwpn_costWPN_COST);
 
 
g_wpnid wpnid;
 return 
PLUGIN_CONTINUE;
}
public 
ev_attack1(id) {
 
wpn_playanim(id,anim_fire1 );
 
emit_sound(idCHAN_WEAPONs_FIRE_11.0ATTN_NORM0PITCH_NORM);
 
wpn_bullet_shot(g_wpnidid0random_num(DMG_PER_BULLET_MINDMG_PER_BULLET_MAX));
 
 return 
PLUGIN_CONTINUE;

new 
user_zoom[33]; 
public 
client_connect(id) { 
     
user_zoom[id] = 0

public 
ev_attack2(id) { 
     if(( 
user_zoom[id] == 0)) { 
            
client_cmd(id,"fov 10"); 
            
user_zoom[id] = 1
     } 
     else if(( 
user_zoom[id] == 1)) { 
                
client_cmd(id,"fov 90"); // normal 
                
user_zoom[id] = 0
     } 
     
client_cmd(id,"-attack2"); 
    return 
PLUGIN_CONTINUE;

public 
ev_draw(id) {
 
wpn_playanim(idanim_draw);
 
 return 
PLUGIN_CONTINUE;
}
public 
ev_reload(id) {
 
wpn_playanim(idanim_reload);
 return 
PLUGIN_CONTINUE;

__________________
+Karma is appreciated! |Be PROUD, leave your name!
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-02-2008 , 20:00   Re: Anyone familiar with WeaponMod ?
Reply With Quote #8

Try 250.0 and not 250. The input is a float.

Quote:
You don't understand what I'm asking, it doesnt matter anyways
So you want the color of trail depending the team ( not white for both ), like the plugin grenade trail ?
__________________

Last edited by Arkshine; 08-02-2008 at 20:04.
Arkshine is offline
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 08-02-2008 , 20:58   Re: Anyone familiar with WeaponMod ?
Reply With Quote #9

Yes red for T and blue for CT

And I will try 250.0 here soon, thanks.
__________________
+Karma is appreciated! |Be PROUD, leave your name!
KingCommentor is offline
Send a message via AIM to KingCommentor
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-03-2008 , 03:59   Re: Anyone familiar with WeaponMod ?
Reply With Quote #10

Replace :

Code:
 write_byte(224)  write_byte(224)  write_byte(255)

by

Code:
    switch ( get_user_team( id ) )     {         case 1 : // terro         {             write_byte(255)             write_byte(0)             write_byte(0)         }         case 2 : // ct         {             write_byte(0)             write_byte(0)             write_byte(255)         }     }

Feel free to adjust the color.
__________________
Arkshine 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 05:39.


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