Создание на Best player of the round

Сообщения
30
Реакции
3
Thank you, but have 2 litlle problems
1. Error logs
Код:
L 04/05/2017 - 20:48:07: Start of error session.
L 04/05/2017 - 20:48:07: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20170405.log")
L 04/05/2017 - 20:48:07: Function "FwdDeathMsgEvent" was not found
L 04/05/2017 - 20:48:08: [AMXX] Displaying debug trace (plugin "best_player.amxx")
L 04/05/2017 - 20:48:08: [AMXX] Run time error 19: function not found
L 04/05/2017 - 20:48:08: [AMXX] [0] best_player.sma::plugin_init (line 21)

2. Best player of the round: Show server name.
 
Последнее редактирование модератором:
Сообщения
657
Реакции
562
Предупреждения
8
Помог
9 раз(а)
Georgi-Arts,
Код:
#include <amxmodx>
#include <cstrike>

#define PLUGIN "Best Player"
#define VERSION "1.0"
#define AUTHOR "RedRobster"

#define IsPlayer(%1) (1 <= %1 <= gMaxPlayers)

new gKills[33]

new gMaxPlayers

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_logevent("RoundStart", 2, "1=Round_Start")
register_logevent("RoundEnd", 2, "1=Round_End")

register_event("DeathMsg", "FwdDeathMsgEvent", "a")

gMaxPlayers = get_maxplayers()
}

public client_connect(id)
gKills[id] = 0

public FwdDeathMsgEvent()
{
new attacker = read_data(1)
new victim = read_data(2)

if(attacker != victim && IsPlayer(attacker) && cs_get_user_team(attacker) != cs_get_user_team(victim))
gKills[attacker]++
}

public RoundStart()
arrayset(gKills, 0, 33)

public RoundEnd()
{
new name[34]
new bestplayer, bestscore

for(new i; i < sizeof(gKills); i++)
{
if(gKills > bestscore)
{
bestplayer = i
bestscore = gKills
}
}

get_user_name(bestplayer, name, 33)

set_hudmessage(0, 255, 0, -1.0, 0.9)
show_hudmessage(0, "Best player of the round: %s", name) //^nKills: %i", name, bestscore)
}

 

Вложения

Последнее редактирование модератором:

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу