我这里还有个 M4A1开镜源码
我也想在里面加入权限···只有VIP会员能开镜···求各位了!!服务器特别需要!!:'( 怪我没学好插件一点都不懂!!! /* 本插件由 AMXX-Studio 中文版自动生成*//* UTF-8 func by www.DT-Club.net */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>
#define PLUGIN_NAME "New Plug-In"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Love灬Weiwei"
#define WEAPON_CSW CSW_M4A1
#define WEAPON_ENT "weapon_m4a1"
#define WEAPON_RELOAD_TIME 4.0
#define WEAPON_DRAW_TIME 2.0
#define WEAPON_ADDSIL_TIME 1.8
#define WEAPON_SHOOT_TIME 2.2
#define TASK_SHOOT 1234
enum {
anim_idle,
anim_reload,
anim_draw,
anim_shoot1,
anim_shoot2,
anim_shoot3,
anim_add,
anim_idle_unsil,
}
new g_reloading,g_addsil,g_shooting,g_hasDoneCurWeap
const m_pPlayer = 41 //用于寻找实体主人
const m_flNextPrimaryAttack = 46
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
register_forward(FM_CmdStart, "forward_cmdstart")
register_forward(FM_UpdateClientData, "UpdateClientData_Post", 1)
register_event("CurWeapon","Current_Weapon","be","1=1")
RegisterHam(Ham_Weapon_PrimaryAttack, WEAPON_ENT, "fw_WeapPriAttack", 1)
RegisterHam(Ham_Weapon_Reload, WEAPON_ENT, "fw_WeaponReload",1);
RegisterHam(Ham_Item_Deploy, WEAPON_ENT, "fw_WeaponDeployPost", 1);
//在此处添加您的代码...
}
public native_playanim(player,anim)
{
set_pev(player, pev_weaponanim, anim)
message_begin(MSG_ONE, SVC_WEAPONANIM, {0, 0, 0}, player)
write_byte(anim)
write_byte(pev(player, pev_body))
message_end()
}
public forward_cmdstart(id, uc_handle, seed)
{
if(!is_user_alive(id) || get_user_weapon(id) != WEAPON_CSW)
return PLUGIN_HANDLED
if((get_uc(uc_handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2) )
{
if(!g_reloading && !g_addsil)
{
if(cs_get_user_zoom(id) == CS_SET_AUGSG552_ZOOM)
{
cs_set_user_zoom(id,CS_RESET_ZOOM,1)
}
else
{
cs_set_user_zoom(id,CS_SET_AUGSG552_ZOOM,1)
}
emit_sound(id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100)
}
}
if( get_uc(uc_handle, UC_Impulse) ==201 && !g_reloading && !g_addsil && !g_shooting)
{
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
remove_task(id)
g_addsil = true
set_task(WEAPON_ADDSIL_TIME,"Finish_addSil",id)
new ent = fm_find_ent_by_owner(-1, WEAPON_ENT,id)
if(cs_get_weapon_silen(ent))
{
cs_set_weapon_silen(ent,0,1)
}
else
{
cs_set_weapon_silen(ent,1,1)
}
}
new cmd
if(g_addsil)
{
if((cmd = get_uc(uc_handle, UC_Buttons)) & IN_ATTACK )
{
cmd &= ~IN_ATTACK
set_uc(uc_handle, UC_Buttons, cmd)
}
if((cmd = get_uc(uc_handle, UC_Buttons)) & IN_RELOAD )
{
cmd &= ~IN_RELOAD
set_uc(uc_handle, UC_Buttons, cmd)
}
}
if((cmd = get_uc(uc_handle, UC_Buttons)) & IN_ATTACK2 )
{
cmd &= ~IN_ATTACK2
set_uc(uc_handle, UC_Buttons, cmd)
}
return PLUGIN_HANDLED
}
public Finish_WeapReload(id)
{
g_reloading = false
}
public Finish_addSil(id)
{
g_addsil = false
if(is_user_alive(id) && get_user_weapon(id) == WEAPON_CSW)
{
new ent = fm_find_ent_by_owner(-1, WEAPON_ENT,id)
if(cs_get_weapon_silen(ent))
native_playanim(id,anim_idle)
else
native_playanim(id,anim_idle_unsil)
}
}
public Finish_shoot(taskid)
{
new id = taskid-TASK_SHOOT
g_shooting = false
}
public Current_Weapon(id)
{
if(!g_hasDoneCurWeap && get_user_weapon(id) != WEAPON_CSW)
{
remove_task(id)
remove_task(id+TASK_SHOOT)
g_reloading = false
g_addsil = false
g_shooting = false
g_hasDoneCurWeap = true
}
}
public UpdateClientData_Post( id, sendweapons, cd_handle )
{
if(!is_user_alive(id) || !g_addsil || get_user_weapon(id) != WEAPON_CSW)
return PLUGIN_HANDLED
set_cd(cd_handle, CD_ID, 1);
return PLUGIN_CONTINUE
}
public fw_WeaponReload(weapon)
{
static id;
id = get_pdata_cbase(weapon, m_pPlayer, 4);
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
remove_task(id)
g_reloading = true
set_task(WEAPON_RELOAD_TIME,"Finish_WeapReload",id)
}
public fw_WeaponDeployPost(weapon)
{
static id;
id = get_pdata_cbase(weapon, m_pPlayer, 4);
remove_task(id)
g_reloading = true
set_task(WEAPON_DRAW_TIME,"Finish_WeapReload",id)
g_hasDoneCurWeap = false
client_print(id,print_chat,"欢迎使用开镜精华,右键开镜,T键使用特殊功能。")
}
public fw_WeapPriAttack(weapon)
{
static id;
id = get_pdata_cbase(weapon, m_pPlayer, 4);
if(cs_get_user_zoom(id) == CS_SET_AUGSG552_ZOOM)
{
static Float:weap_delay
weap_delay = get_pdata_float(weapon, 46, 4) * 1.5
set_pdata_float(weapon, m_flNextPrimaryAttack, weap_delay, 4)
}
remove_task(id+TASK_SHOOT)
g_shooting = true
set_task(WEAPON_SHOOT_TIME,"Finish_shoot",id+TASK_SHOOT)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
*/
晕死真是没人帮新手的啊?? 帮忙加入 A权限拜托了!!!!!!!!!!!!!!!!! 请求各位大大能帮忙加个权限求各位了······
:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'(:'( :Q没有人吗? 我是在想楼主哪来的源码... 6# 业余插件者
郁闷难道我不找啊?? 直接开镜?? 好像是黄金AK的原代码吧 m4a1开镜有什么用呢 不适合远距离攻击啊
奇怪的插件
页:
[1]