DanRaZor & RideeR ;]
Описание:
Плъгинът добавя top за headshots в сървъра ви.Също така има и % на headshots от общите убийства на играча.
- say /hstop
- say /hsall
- say_team /hstop
- say_team /hsall
VIP
|
Cs-PlovdiV.com - Aim Attack 93.123.16.4:27022 |
aim_aztec Играчи: 0/16 |
|
VIP
|
93.123.16.4:27022 | Cs-PlovdiV.com - Aim Attack | aim_aztec | 0/16 |
Код за потвърждение: Избери целия код
L 01/26/2017 - 18:25:44: Start of error session.
L 01/26/2017 - 18:25:44: Info (map "de_train32") (file "addons/amxmodx/logs/error_20170126.log")
L 01/26/2017 - 18:25:44: [AMXX] Displaying debug trace (plugin "Headshots_deluxe.amxx")
L 01/26/2017 - 18:25:44: [AMXX] Run time error 5: memory access
L 01/26/2017 - 18:25:44: [AMXX] [0] Headshots_deluxe.sma::cmd_hsall (line 139)
Ant1Lamer написа:И крашва сървъра даже някои път не отваря мотдКод за потвърждение: Избери целия код
L 01/26/2017 - 18:25:44: Start of error session. L 01/26/2017 - 18:25:44: Info (map "de_train32") (file "addons/amxmodx/logs/error_20170126.log") L 01/26/2017 - 18:25:44: [AMXX] Displaying debug trace (plugin "Headshots_deluxe.amxx") L 01/26/2017 - 18:25:44: [AMXX] Run time error 5: memory access L 01/26/2017 - 18:25:44: [AMXX] [0] Headshots_deluxe.sma::cmd_hsall (line 139)
Код за потвърждение: Избери целия код
#include <amxmodx>
#define MAX_TXT_LEN 300
new iKills[33], iKiller = 0, iHeadShots[33], ranking[33]
new titleMotd[30] = "HEADSHOT : Rankings"
new noHeadshot[50]= "No Headshots, try again later"
new textFrags[25] = "Frags"
public plugin_init()
{
register_plugin("Headshot Deluxe", "1.0", "DanRaZor & RideeR ;]")
register_clcmd("say /hsall", "cmd_hsall")
register_clcmd("say /hstop", "cmd_hsall")
register_clcmd("say_team /hsall", "cmd_hsall")
register_clcmd("say_team /hstop", "cmd_hsall")
register_event("DeathMsg", "eventDeathMsg", "a")
}
public eventDeathMsg()
{
iKiller = read_data(1)
new iVictim = read_data(2)
if(iKiller == iVictim || !is_user_connected(iKiller))
{
return
}
if(read_data(3) == 1)
{
iHeadShots[iKiller]++
update_rankings()
}
iKills[iKiller]++
}
public cmd_hsall(id)
{
new title[80]
new topText[2000]
new NameP[32]
new textC1[200]
new textC2[700]
new textC3[200]
new textC4[200]
new textC5[200]
new NB = 0
formatex(title, charsmax(title), titleMotd)
for(new d = 1 ;d < 16; ++d)
{
new userId = ranking[d]
if(userId == 0)
{
d = 50
}
else if(is_user_connected(userId))
{
if(iHeadShots[userId] > 0)
{
get_user_name (userId, NameP, charsmax(NameP))
new Float:percent = (float(iHeadShots[userId]) / float(iKills[userId])) * 100
new temp1[128]
formatex(temp1, 9, "%d<br>", d)
add(textC1, charsmax(textC1), temp1)
add(textC2, charsmax(textC2), NameP)
add(textC2, charsmax(textC2), "<br>")
new temp3[128]
formatex(temp3, charsmax(temp3), "%d<br>", iHeadShots[userId])
add(textC3,charsmax(textC3),temp3)
new temp4[128]
formatex(temp4, charsmax(temp4), "%.1f<br>", percent)
add(textC4, 199, temp4)
add(textC5, 199, "%<br>")
++NB
}
}
}
if(NB == 0)
{
add(topText, charsmax(topText), "<html><head></head><body bgcolor=^"#000000^" text=^"#000000^">")
add(topText, charsmax(topText), "<div align=^"center^">")
add(topText, charsmax(topText), "<font size=^"2^" face=^"Arial, Helvetica, sans-serif^" color=#FF0000>")
add(topText, charsmax(topText), "<br><br><b>")
new temp6[100]
formatex(temp6, charsmax(temp6), "%s ...", noHeadshot)
add(topText, charsmax(topText), temp6)
add(topText, charsmax(topText), "</b></font></div></body></html>")
}
else
{
add(topText, charsmax(topText), "<html><head></head><body bgcolor=^"#000000^" text=^"#000000^">")
add(topText, charsmax(topText), "<table align=^"center^" width=^"80%^">")
add(topText, charsmax(topText), "<td bgcolor=^"#000000^" width=^"12%^">")
add(topText, charsmax(topText), "<div align=^"center^">")
add(topText, charsmax(topText), "<font size=^"2^" face=^"Arial, Helvetica, sans-serif^" color=#FF0000><br><b><hr>")
add(topText, charsmax(topText), textC1)
add(topText, charsmax(topText), "</b></td><td bgcolor=^"#000000^"><div align=^"left^" width=^"48%^">")
add(topText, charsmax(topText), "<font size=^"2^" face=^"Arial, Helvetica, sans-serif^" color=#FF0000><br><b><hr>")
add(topText, charsmax(topText), textC2)
add(topText, charsmax(topText), "</b></font></div></td><td bgcolor=^"#000000^" width=^"20%^"><div align=^"center^">")
add(topText, charsmax(topText), "<font size=^"2^" face=^"Arial, Helvetica, sans-serif^" color=#FF0000><b>HS</b><br><b><hr>")
add(topText, charsmax(topText), textC3)
add(topText, charsmax(topText), "</b></font></div></td><td bgcolor=^"#000000^" width=^"15%^"><div align=^"right^">")
add(topText, charsmax(topText), "<font size=^"2^" face=^"Arial, Helvetica, sans-serif^" color=#FF0000><b>Frags</b><br><b><hr>")
add(topText, charsmax(topText), textC4)
add(topText, charsmax(topText), "</b></font></div></td><td bgcolor=^"#000000^" width=^"5%^"><div align=^"left^">")
add(topText, charsmax(topText), "<font size=^"2^" face=^"Arial, Helvetica, sans-serif^" color=#FF0000><br><b><hr>")
add(topText, charsmax(topText), textC5)
add(topText, charsmax(topText), "</b></font></div></td></table></body></html>")
for(new d = 1; d < 33; ++d)
{
new userId = ranking[d]
if(userId == 0)
{
d = 50
}
else if(is_user_connected(userId))
{
if(iHeadShots[userId] > 0)
{
get_user_name(userId, NameP, charsmax(NameP))
new Float:percent = (float(iHeadShots[userId]) / float(iKills[userId])) * 100
new temp[MAX_TXT_LEN]
formatex(temp, charsmax(temp), "^n%d - %s^n %4d Headshot(s) - %s %.1f %% ", d, NameP, iHeadShots[userId], textFrags, percent)
add(topText, charsmax(topText), temp)
++NB
}
}
}
}
show_motd(id, topText, title)
return PLUGIN_CONTINUE
}
public update_rankings()
{
for(new z = 1; z < 33; ++z)
{
if(ranking[z] == 0)
{
ranking[z] = iKiller
return PLUGIN_CONTINUE
}
else if(ranking[z] != iKiller)
{
if(iHeadShots[iKiller] > iHeadShots[ranking[z]])
{
for(new w = 32; w > z; --w)
{
ranking[w] = ranking[w-1]
}
ranking[z] = iKiller
new dec = 0
for(new x = z+1; x < 33; ++x)
{
if(ranking[x] == iKiller)
{
++dec
ranking [33-dec] = 0
}
if(x+dec < 33)
ranking[x]=ranking[x+dec]
}
return PLUGIN_CONTINUE
}
else if(iHeadShots[iKiller] == iHeadShots[ranking[z]])
{
new Float:prct1 = (float(iHeadShots[iKiller]) / float(iKills[iKiller])) * 100
new Float:prct2 = (float(iHeadShots[ranking[z]]) / float(iKills[ranking[z]])) * 100
if(prct1 > prct2)
{
for(new w = 32; w > z; --w)
{
ranking[w] = ranking[w-1]
}
ranking[z] = iKiller
new dec = 0
for(new x = z+1; x < 33; ++x)
{
if(ranking[x] == iKiller)
{
++dec
ranking [33-dec] = 0
}
if(x+dec < 33)
ranking[x]=ranking[x+dec]
}
return PLUGIN_CONTINUE
}
}
}
else if(ranking[z] == iKiller)
{
return PLUGIN_CONTINUE
}
}
return PLUGIN_CONTINUE
}
Потребители разглеждащи този форум: 0 регистрирани и 0 госта