retry 发表于 2009-8-27 21:31:52

求大家看看,感谢

本帖最后由 retry 于 2009-8-28 14:44 编辑

这个是第一局雷战且手雷无限,用了感觉给手雷慢点,怎么改成扔出之后马上就给的那种,求高手看看,另外我想多玩几局雷战要怎么改,谢谢#include <amxmodx>
#include <cstrike>
#include <fun>
#include <engine>
#define PLUGIN "FirstRoundhegrenade"
#define VERSION "0.2.16"
#define AUTHOR "iG_os"
new bool:FirstRound = true
new bool:iTask
new ModName

public switchweapon(id)
{
    if(!FirstRound)
      return PLUGIN_CONTINUE
    new HE = cs_get_user_bpammo(id, CSW_HEGRENADE)
    if((!HE) && (!iTask))
    {
      new paramID
      paramID = id
      set_task(0.6, "give_hegrenade", id, paramID, 1)
      iTask = true
      return PLUGIN_CONTINUE
    }
    new WeaponID = read_data(2)
    if (HE)
    if (WeaponID!=CSW_HEGRENADE)
      engclient_cmd(id, "weapon_hegrenade")
    return PLUGIN_CONTINUE
}

public give_hegrenade(paramID[])
{
    new id = paramID
    if ( FirstRound && is_user_alive(id) )
    {
      new HE = cs_get_user_bpammo(id, CSW_HEGRENADE)
      if (!HE)
         give_item(id, "weapon_hegrenade") //给雷
      engclient_cmd(id, "weapon_hegrenade")
      iTask = false
    }
}

public StartSetting(paramID[])
{
    new id = paramID
    if ( FirstRound && is_user_alive(id) )
      give_item(id, "item_assaultsuit")
}

public newround(id)
{
    if (FirstRound)
    {
      new task_msgID = id+100
      new task_startID = id+200
      if (task_exists(task_msgID)) remove_task(task_msgID)
      if (task_exists(task_startID)) remove_task(task_startID)
      iTask = false
      new paramID
      paramID = id
      set_task(3.0, "Mode_msg", task_msgID, paramID, 1, "a", 3)
      set_task(2.5, "StartSetting", task_startID, paramID, 1)
    }
    return PLUGIN_CONTINUE
}

public restartround()
{
    FirstRound = true
    return PLUGIN_CONTINUE
}

public end_round()
{
    FirstRound = false
    return PLUGIN_CONTINUE
}

public message_TextMsg(msg_id, msg_dest, entity)

{
    if (!FirstRound || !get_cvar_num("he_blockfireinthehole"))
      return PLUGIN_CONTINUE
    new argNum = get_msg_args() //获取参数数量,少于5个就不是radio信息
    if (argNum<5) return PLUGIN_CONTINUE
    new string
    if (equal(ModName,"cstrike"))
    { //适应CS
      get_msg_arg_string(3, string, 29)
      if (!equal(string, "#Game_radio"))
            return PLUGIN_CONTINUE
      get_msg_arg_string(5, string, 29) //CS 取第5个参数
    }
    else
    { //适应CZ
      get_msg_arg_string(3, string, 29)
      if (!equal(string, "#Game_radio_location"))
         return PLUGIN_CONTINUE
      get_msg_arg_string(6, string, 29) //CZ 取第6个参数
    }
    if (!equal(string, "#Fire_in_the_hole"))
      return PLUGIN_CONTINUE
    if (get_cvar_num("he_blockfireinthehole"))
      return PLUGIN_HANDLED // 消除 “Fire in the hole” 文字显示...
    return PLUGIN_CONTINUE
}

public message_SendAudio(msg_id, msg_dest, entity)
{
    if (!FirstRound || !get_cvar_num("he_blockfireinthehole"))
      return PLUGIN_CONTINUE
    new string

    get_msg_arg_string(2, string, 19)
    if (equal(string, "%!MRAD_FIREINHOLE"))
      return PLUGIN_HANDLED // 消除 “Fire in the hole” 声音...
    return PLUGIN_CONTINUE
}

public Mode_msg(paramID[])
{
    new id = paramID
    //client_print(id,print_chat,"->第一局混战<-")
    new msg
    format(msg,99,"^x03轻松时间^x01>>^x04")
    message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
    write_byte(id)
    write_string(msg)
    message_end()
}

public plugin_init()
{
    register_plugin(PLUGIN,VERSION,AUTHOR)
    register_cvar("he_blockfireinthehole", "1")
    register_event("ResetHUD", "newround", "be")
    register_event("TextMsg", "restartround", "a", "2&#Game_C", "2&#Game_w")
    register_event("SendAudio", "end_round", "a", "2&%!MRAD_terwin",
                           "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw")
    register_event("CurWeapon", "switchweapon", "be", "1=1")
    register_message(get_user_msgid("SendAudio"), "message_SendAudio")
    register_message(get_user_msgid("TextMsg"), "message_TextMsg")
    get_modname(ModName, 9)
}

zwfgdlc 发表于 2009-8-28 02:15:04


set_task(0.6, "give_hegrenade", id, paramID, 1)
改成 set_task(0.1, "give_hegrenade", id, paramID, 1)

retry 发表于 2009-8-28 10:54:22

感谢您的帮助,晚上去试试

retry 发表于 2009-8-28 14:44:28

另外想问下,多玩几句雷战或者一直雷战也不错的,需要怎么改啊,谢谢
页: [1]
查看完整版本: 求大家看看,感谢