|
楼主 |
发表于 2017-5-2 10:20:50
|
显示全部楼层
来自 中国–辽宁–大连
大神 我用了这个命令后 C4可以按了 但是C4爆炸后 下回合时间是固定的了0分
如何在取消这个固定时间
也就是取消set_msg_block(get_user_msgid("RoundTime"),BLOCK_SET)设置 新回合回复正常时间
这是我现在的代码
#include <amxmodx>
#include <csx>
#include <cstrike>
public BombPlanted
public BombCountVoice
public BombCountDef
new g_C4Timer
new g_Defusing
new Float:g_LastOmg
new g_LastAnnounce
new g_announce_sync
public plugin_init()
{
register_plugin("CS Misc. Stats", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("miscstats.txt")
register_event("TextMsg", "eRestart", "a", "2&#Game_C", "2&#Game_w")
register_event("SendAudio", "eEndRound", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw")
//register_event("RoundTime", "eNewRound", "bc")
}
announceEvent(id, message[])
{
new name[32]
get_user_name(id, name, 31)
set_hudmessage(255, 100, 50, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, -1)
ShowSyncHudMsg(0, g_announce_sync, "%L", LANG_PLAYER, message, name)
}
public bombTimer()
{
if (--g_C4Timer > 0)
{
if (BombCountVoice)
{
if (g_C4Timer == 30 || g_C4Timer == 20)
{
new temp[64]
num_to_word(g_C4Timer, temp, 63)
format(temp, 63, "^"vox/%s seconds until explosion^"", temp)
play_sound(temp)
}
else if (g_C4Timer < 11)
{
new temp[64]
num_to_word(g_C4Timer, temp, 63)
format(temp, 63, "^"vox/%s^"", temp)
play_sound(temp)
}
}
if (BombCountDef && g_Defusing)
client_print(g_Defusing, print_center, "%d", g_C4Timer)
}
else
remove_task(8038)
}
public eRestart()
{
eEndRound()
}
public eEndRound()
{
g_C4Timer = -2
g_LastOmg = 0.0
remove_task(8038)
g_LastAnnounce = 0
}
public bomb_planted(planter)
{
g_Defusing = 0
if (BombPlanted)
announceEvent(planter, "SET_UP_BOMB")
g_C4Timer = get_cvar_num("mp_c4timer")
set_task(1.0, "bombTimer", 8038, "", 0, "b")
set_msg_block(get_user_msgid("RoundTime"),BLOCK_SET)
}
public play_sound(sound[])
{
new players[32], pnum
get_players(players, pnum, "c")
new i
for (i = 0; i < pnum; i++)
{
if (is_user_connecting(players[i]))
continue
client_cmd(players[i], "spk %s", sound)
}
}
|
|