R版帮一下帮啊..
本帖最后由 q352332201 于 2011-1-14 13:08 编辑一个第一局无限手雷的插件..
它的问题是第一局开始的时候在聊天区域显示不出字来..
如图 就是那个
" 口>> "这样的..
可不可以把它修改为在时间显示上面那块区域显示:
轻松一下
->第一局手雷战<-
而且还会闪的红色字体?
源码在此#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)
} {:2_33:}R版快出现啊....... 应该是编码问题 帮你改好了
为了编译方便 插件名我改了下 版权归原作者所有
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <engine>
#define PLUGIN "wxlz"
#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轻松一下 ^x04VS^x01 第一局手雷战")
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)
} 5# 114772348
这样每局都是无限手雷- - 每局都是手雷吗? 7# fz12
我编译5楼的就是每局都是无限手雷.... 是无限手雷-
页:
[1]