3252533 发表于 2010-10-11 00:42:20

R版主麻烦能帮我取消掉这个吗?

很郁闷的说 , Q切换武器时老是出现这个出来!!!/* 本插件由 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 || !(get_user_flags(id) & ADMIN_LEVEL_C))
                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,"VIP超级M4专属武器,右键开镜,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 }
*/

3252533 发表于 2010-10-11 00:43:19

能帮我 改一下吗???老是出现这个 很烦的

3252533 发表于 2010-10-11 00:44:42

还有在麻烦你 能帮我加入个权限吗??R我知道你在线的:loveliness:/* AMX MOD Script
*Hydralisk
*2005.7.16
*For RonyDick
*Admin Command:
*    hy_sun_wear <nick> <0/1> :   1-make someone have sunglasses, 1-make someone haven't sunglasses
*User Command:
*    buyglasses               :   buy sun glasses
*    say sunglasses         :   buy sun glasses
*Cvar:
*    hy_sun_cost <money>      :   the price of sun glasses
*    hy_sun_times <number>    :   set how many times can a sunglasses be used up.
*Info:
*    Sun glasses can keep one from flashbang.
*    Sun glasses will lost if the player dead.
*/

#include <amxmod>
#include <amxmisc>


#define ICON_HIDE 0
#define ICON_SHOW 1
#define ICON_FLASH 2
#define ICON_S "suithelmet_full"


new wear_sun
new bool:in_buyzone

public plugin_init(){
        register_plugin("Sun Glasses","0.1","Hydralisk")
      register_clcmd("buyglasses","buyglasses",ADMIN_RESERVATION,"buy sun glasses")
      register_clcmd("say sunglasses","buyglasses",ADMIN_RESERVATION,"buy sun glasses")
      register_concmd("hy_sun_wear","wearglasses",ADMIN_RESERVATION|ADMIN_LEVEL_B,"<nick> <0/1>")
        register_cvar("hy_sun_cost","800")
        register_cvar("hy_sun_times","8")
        register_event("ScreenFade","det_fade","be","1!0","2!0","7!0")
        register_event("TextMsg", "end_round", "a", "2&#Game_C", "2&#Game_w")
        register_event("DeathMsg","death","a")
        register_event("ResetHUD","reset","b")
        register_event("StatusIcon","detBuy","be","2=buyzone")
        return PLUGIN_CONTINUE
}

public detBuy(id){
        if (read_data(1))
                in_buyzone = true
        else
                in_buyzone = false

        return PLUGIN_CONTINUE

}

public death(){
        new id = read_data(2)
        wear_sun = 0
        screen_icon(id,ICON_S,0,0,0,ICON_HIDE)
        return PLUGIN_CONTINUE
}

public reset(id){
        if (wear_sun>1){
                new full = get_cvar_num("hy_sun_times")
                full = floatround(255.0 * float(wear_sun)/float(full))
                screen_icon(id,ICON_S,0,full,255-full,ICON_SHOW)
        }
        if (wear_sun == 1){
                screen_icon(id,ICON_S,0,0,255,ICON_FLASH)
        }
        return PLUGIN_CONTINUE
}

public end_round(){
        for (new i = 1; i<=32;i++)
                wear_sun = 0
}

public det_fade(id){
        if (wear_sun){
                wear_sun --
                screen_fade(id,0,0,0,0,0)
                set_hudmessage(255,0,0,-1.0,-0.45,1,6.0,10.0,1.3,0.7,9)
                show_hudmessage(id,"Your sunglasses have just keep you from a flashbang, %d times left.",wear_sun)
                if (wear_sun>1){
                        new full = get_cvar_num("hy_sun_times")
                        full = floatround(255.0 * float(wear_sun)/float(full))
                        screen_icon(id,ICON_S,255-full,full,0,ICON_SHOW)
                }
                if (wear_sun == 1){
                        screen_icon(id,ICON_S,0,255,0,ICON_FLASH)
                }
                if (wear_sun == 0){
                        screen_icon(id,ICON_S,0,0,0,ICON_HIDE)
                }
        }
}

public buyglasses(id){
        new cmd,bool:rtn
        read_argv(0,cmd,32)
        if (equal(cmd,"buyglasses"))
          rtn = true
        else
          rtn = false
        if (!is_user_alive(id)) return rtn?PLUGIN_HANDLED:PLUGIN_CONTINUE
        if (!in_buyzone) return rtn?PLUGIN_HANDLED:PLUGIN_CONTINUE
        new full = get_cvar_num("hy_sun_times")
        if (wear_sun >= full){
                client_print(id,print_center,"You have already got the sun glasses")
                return rtn?PLUGIN_HANDLED:PLUGIN_CONTINUE
        }
        new moneycost = get_cvar_num("hy_sun_cost")
        new pmoney = get_user_money(id)
        if (moneycost > pmoney){
                client_print(id,print_center,"You have not enough money")
                return rtn?PLUGIN_HANDLED:PLUGIN_CONTINUE
        }
        set_user_money(id,pmoney - moneycost)
        wear_sun = full
        if (wear_sun>1){
                full = floatround(255.0 * float(wear_sun)/float(full))
                screen_icon(id,ICON_S,255-full,full,0,ICON_SHOW)
        }
        if (wear_sun == 1){
                screen_icon(id,ICON_S,0,255,0,ICON_FLASH)
        }       
        return rtn?PLUGIN_HANDLED:PLUGIN_CONTINUE
}

public wearglasses(id,level,cid){
        if (!cmd_access(id,level,cid,3)) return PLUGIN_HANDLED
        new arg,arg2
        read_argv(1,arg,32)
        read_argv(2,arg2,7)
        new player = cmd_target(id,arg,4)
        if (!player) return PLUGIN_HANDLED
        new name
        get_user_name(player,name,32)
        if (equal(arg2,"1")){
                wear_sun = get_cvar_num("hy_sun_times")
                if (wear_sun>1){
                        new full = get_cvar_num("hy_sun_times")
                        full = floatround(255.0 * float(wear_sun)/float(full))
                        screen_icon(player,ICON_S,255-full,full,0,ICON_SHOW)
                }
                if (wear_sun == 1){
                        screen_icon(player,ICON_S,0,255,0,ICON_FLASH)
                }
                console_print(id,"%s has been armed",name)
        } else if (equal(arg2,"0")){
                wear_sun = 0
                screen_icon(player,ICON_S,0,0,0,ICON_HIDE)
                console_print(id,"%s has been disarmed",name)
        } else {
                console_print(id,"the 3rd parm must be 0 or 1")
        }
        return PLUGIN_HANDLED
}

public client_connect(id){
        wear_sun = 0
}

stock screen_icon(id,icon[],r,g,b,type){
//        new string = {"dmg_rad","item_longjump","dmg_shock","item_healthkit","dmg_heat","suit_full","cross","dmg_gas"}
        message_begin( MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id )
        write_byte( type ) // status
        write_string( icon ) // sprite name
        write_byte( r ) // red
        write_byte( g ) // green
        write_byte( b ) // blue
        message_end()
}

stock screen_fade(id,r,g,b,alpha,tm){
        message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id)
        write_short( 1<<tm ) // fade lasts this long duration
        write_short( 1<<tm ) // fade lasts this long hold time
        write_short( 1<<12 ) // fade type (in / out)
        write_byte( r ) // fade red
        write_byte( g ) // fade green
        write_byte( b ) // fade blue
        write_byte( alpha ) // fade alpha
        message_end()
}

starekr 发表于 2010-10-11 08:15:22

是不是你绑定了 Q键为购买超级M4啊?

3252533 发表于 2010-10-11 13:22:08

4# starekr


不是购买!!! 麻烦能看一下源码吗?吗?

rsdtt 发表于 2010-10-11 20:15:29

{:2_38:}
//client_print(id,print_chat,"VIP超级M4专属武器,右键开镜,T键使用特殊功能。")

3252533 发表于 2010-10-11 20:37:02

6# rsdtt


我取消过了,编辑总是错误的

3252533 发表于 2010-10-11 20:39:40

很郁闷啊 !!!

rsdtt 发表于 2010-10-11 21:04:32

<fakemeta_util
你自己缺这个,本来就编译不了

3252533 发表于 2010-10-11 21:30:36

9# rsdtt


版主,那能帮我加入个权限吗? 下面的源码 拜托了
页: [1] 2
查看完整版本: R版主麻烦能帮我取消掉这个吗?