|
发表于 2009-1-29 21:41:28
|
显示全部楼层
来自 中国–广东–深圳
3# dsylmm
看下statsx插件。- // Get and format rankstats
- format_rankstats(id, sBuffer[MAX_BUFFER_LENGTH + 1], iMyId = 0)
- {
- new izStats[8] = {0, ...}
- new izBody[8]
- new iRankPos, iLen
- new lKills[16], lHs[16], lDeaths[16], lHits[16], lShots[16], lDamage[16], lEff[16], lAcc[16], lLb[16]
- format(lKills, 15, "%L", id, "KILLS")
- format(lHs, 15, "%L", id, "HS_1")
- format(lDeaths, 15, "%L", id, "DEATHS")
- format(lHits, 15, "%L", id, "HITS")
- format(lShots, 15, "%L", id, "SHOTS")
- format(lDamage, 15, "%L", id, "DAMAGE")
- format(lEff, 15, "%L", id, "EFF")
- format(lAcc, 15, "%L", id, "ACC")
- format(lLb, 15, "%L", id, "LB_1")
-
- ucfirst(lEff)
- ucfirst(lAcc)
-
- iRankPos = get_user_stats(id, izStats, izBody)
- iLen = format( sBuffer, MAX_BUFFER_LENGTH,
- "<head><META http-equiv=Content-Type content='text/html ;charset=UTF-8'></head><style>body{color:#FFCC99;background-color:black;margin-top:5}.A{background-color:#310000}.B{background-color:#630000}td{font-size:14px}</style><center><b><font size=4>RANKSTATS</b></center><tr><td> </td><td> </td></tr>" )
- iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "<tr><td colspan=2>%L %L^n^n</td></tr>", id, (!iMyId || iMyId == id) ? "YOUR" : "PLAYERS", id, "RANK_IS", iRankPos, get_statsnum())
- iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "<table width=300><tr class=B><td>%s:<td>%d<td>[%s]:<td>%d</tr><tr class=A><td>%s:<td>%d<tr class=B><td>%s:<td>%d<tr class=A><td>%s:<td>%d<tr class=B><td>%s:<td>%d<tr class=A><td>%s:<td>%0.2f%%<tr class=B><td>%s:<td>%0.2f%%</tr><tr><td> </td><td> </td></tr></table>",
- lKills, izStats[STATS_KILLS], lHs, izStats[STATS_HS], lDeaths, izStats[STATS_DEATHS], lHits, izStats[STATS_HITS], lShots, izStats[STATS_SHOTS],
- lDamage, izStats[STATS_DAMAGE], lEff, effec(izStats), lAcc, accuracy(izStats))
-
- new L_BODY_PART[8][32]
-
- for (new i = 1; i < 8; i++)
- {
- format(L_BODY_PART[i], 31, "%L", id, BODY_PART[i])
- }
-
- iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "<tr><td colspan=2>%10s:</td></tr><table width=170><tr class=B><td>%10s:<td> %d^n<tr class=A><td>%10s:<td> %d^n<tr class=B><td>%10s:<td> %d^n<tr class=A><td>%10s:<td> %d^n<tr class=B><td>%10s:<td> %d^n<tr class=A><td>%10s:<td> %d^n<tr class=B><td>%10s:<td> %d</table>",
- lLb, L_BODY_PART[1], izBody[1], L_BODY_PART[2], izBody[2], L_BODY_PART[3], izBody[3], L_BODY_PART[4], izBody[4], L_BODY_PART[5],
- izBody[5], L_BODY_PART[6], izBody[6], L_BODY_PART[7], izBody[7])
- }
复制代码 |
|