|
Senior Member
|
11-08-2018
, 14:48
Re: Module: Counter-Strike Weapon Mod [1.6.3]
|
#28
|
Quote:
Originally Posted by Ghosted
That would require a bit code.
RegisterWeaponForward on primary attack post and then send weapon animation.
animation will be left or right depends on which was previous. you can do this by using custom entity variable than is not used by original dll. for example EV_INT_iuser4/pev_iuser4 and set 1/0. 0 will be left 1 will be right.
Example:
Code:
MyHookedForward(Weapon)
{
static IsRight = entity_get_int(Weapon, EV_INT_iuser4);
SendWeaponAnim(Weapon, IsRight ? <YourRightAnimation> : <YourLeftAnimation>);
entity_set_int(Weapon, EV_INT_iuser4, !IsRight);
}
|
You module crash too much on rehlds server, no error log given. I just create a simple weapon replacement for rifle.
BTW this is just a basic weapon replacement:
Spoiler
PHP Code:
#include <amxmodx>
#include <cswm>
#define SOUND_CW_SHOOT "weapons/horsegun-1.wav"
#define MODEL_CW_V "models/v_horsegun.mdl"
#define MODEL_CW_P "models/p_horsegun.mdl"
#define MODEL_CW_W "models/w_horsegun.mdl"
#define HUD_CW_LIST "weapon_horsegun"
#define SPR_CW_HUD "sprites/640hud_horsegun.spr"
new iCusWpnId
public plugin_precache()
{
RegisterCustomWeapon()
}
public plugin_init()
{
register_plugin("CSO MP7A1 Unicorn", __DATE__, "metal_upa")
register_clcmd("say /wpn", "Get_CustomWeapon")
}
RegisterCustomWeapon()
{
iCusWpnId = CreateWeapon("horsegun", Rifle, "MP7A1 Unicorn")
BuildWeaponModels(iCusWpnId, MODEL_CW_V, MODEL_CW_P, MODEL_CW_W)
BuildWeaponDeploy(iCusWpnId, 0, 0.0)
BuildWeaponPrimaryAttack(iCusWpnId, 0.1, 1.5, 0.3)
BuildWeaponReload(iCusWpnId, 0, 0.0)
BuildWeaponFireSound(iCusWpnId, SOUND_CW_SHOOT)
BuildWeaponAmmunition(iCusWpnId, 35, WAmmoType_762Nato)
BuildWeaponList(iCusWpnId, HUD_CW_LIST)
//Precache weapon resources.
//ReHLDS: no need to precache sound in model.
PrecacheWeaponGeneric(SPR_CW_HUD)
}
public Get_CustomWeapon(id3)
{
for(new id=1;id<=MaxClients;id++)
{
if(is_user_alive(id))
{
GiveWeaponByID(id, iCusWpnId)
GiveAmmo(id, WAmmoType_762Nato, 100)
}
}
return PLUGIN_HANDLED;
}
Can you make a complete documentation of this module, your wiki seems to be out dated.
|
|
|
|