你是加在像PlayerPreThink整個回合執行的forward裡嗎??
複製程式
new norandom[33]
public plugin_init()
{
register_forward(FM_PlayerPreThink, "fwd_PlayerPreThink")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
public fwd_PlayerPreThink(id)
{
if ((get_user_x1(id)) & (get_user_health(id) < 2000 ) && !norandom[id])
{
new rass = random_num(1, 5)
switch(rass)
{
case 1: norandom[id] = true
case 2: norandom[id] = true
case 3:
{
zp_make_user_x2[id] //這是什麼??
norandom[id] = true
set_user_health(id, 10000)
set_hudmessage(255, 150, 20, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
show_hudmessage(0, "X-2 出現!")
}
case 4: norandom[id] = true
case 5: norandom[id] = true
}
}
}
public event_round_start()
{
for (new id = 1; id <= 32; id++)
{
norandom[id] = false //新的回合消除這個變數
}
}
不知道這樣有沒有效