ZP4.2如何新增&修改玩家等級升級公告資訊??

Home Home
引用 | 編輯 glay2005
2011-08-03 17:01
樓主
推文 x0
最近我想新增一個玩家等級升級公告資訊的功能
想全體玩家皆可看見此資訊
雖然經測試過字幕有顯示出來
但是玩家ID遲遲沒有顯示只顯示後方資訊
請問要如何正確註冊get_user_name語法或者新增新的代嗎??

複製程式
public eDeath()
{
       new attacker = read_data(1)
       new damage = read_data(2)
       new headshot = read_data(3)
       new name[35]
       SM3[damage] = false
       SAKM4[damage] = false
       SMP5[damage] = false
       STMP[damage] = false
       g_hasantidotegun[damage] = false
       BunnyHop[damage] = false
       HLight[damage] = false
       if (attacker && (attacker != damage))
       {
                     if (headshot)
                     {
                            ZPKillPoint[attacker] += 5
                            client_print(attacker, print_chat, "你爆頭消滅敵人.獲得 5 EXP經驗值.")
                     }

                     else
                     {
                            ZPKillPoint[attacker] += 3
                            client_print(attacker, print_chat, "你消滅敵人.獲得 3 EXP經驗值.")
                     }

                     while(ZPKillPoint[attacker] >= LEVELS[level[attacker]])
                     {
                            if(get_user_flags(attacker) & ACCESS_FLAG3)
                                   levelpoint[attacker] += 4
                            else
                                   levelpoint[attacker] += 4
                            ZPKillRank[attacker] += 1
                            level[attacker] += 1
                            client_print(0, print_chat, " %s 升級至[階級:%s | EXP:%d]^n", name, RANKS[ZPKillRank[id]], ZPKillPoint[id])
                     }
       }
        return PLUGIN_CONTINUE
}



獻花 x0
引用 | 編輯 8106125
2011-08-05 15:36
1樓
  
複製程式
new name[32]
get_user_name(id, name, 31)


獻花 x0
引用 | 編輯 glay2005
2011-08-05 19:10
2樓
  
下面是引用 8106125 於 2011-08-05 15:36 發表的 : 到引言文
複製程式
new name[32]
get_user_name(id, name, 31)
之前有試過是無效的0.0

之後自行嘗試編譯public check_level(id)就解決了0.0

獻花 x0