- Ошибка
-
\scripting\reapi_kill_assist.sma(57) : error 088: number of arguments does not match definition
// 1 Error.
- Компилятор
- Локальный
- Amx Mod X
- 1.9.0
- Исходный код
-
#include <amxmodx>
#include <reapi>
#define MONEY 300 // Сколько денег добавить ассисту
#define SUPPORT_CSSTATS_MYSQL // Защитать фраг в статистику плагина от скальпеля
new Float:g_fDamage[33][33];
new g_iAssist[33];
new g_msgScoreInfo;
#if defined SUPPORT_CSSTATS_MYSQL
native csstats_set_user_value(index, ident, value);
native csstats_get_user_value(index, ident);
#endif
#if AMXX_VERSION_NUM < 183
new MaxClients;
#define client_disconnected client_disconnect
#endif
#define ValidPlayersID(%1,%2) ((1 <= %1 <= MaxClients) && (1 <= %2 <= MaxClients))
public plugin_init()
{
register_plugin("[ReAPI] KiLL Assist", "1.1", "neugomon");
RegisterHookChain(RG_CBasePlayer_TakeDamage, "fwdPlayerTakeDamagePost",true);
RegisterHookChain(RG_CBasePlayer_Killed, "fwdPlayerKilledPost", true);
RegisterHookChain(RG_RoundEnd, "fwdRoundEnd", true);
#if AMXX_VERSION_NUM < 183
MaxClients = get_maxplayers();
#endif
g_msgScoreInfo = get_user_msgid("ScoreInfo");
}
public client_disconnected(id)
ResetAssist(id);
public fwdRoundEnd()
{
for(new id = 1; id <= MaxClients; id++)
ResetAssist(id);
}
public fwdPlayerTakeDamagePost(const id, pevInflictor, attacker, Float:flDamage)
{
if(id == attacker)
return;
if(!ValidPlayersID(id, attacker))
return;
if(!GetHookChainReturn() && get_entvar(id, var_deadflag) != 1)
return; // TakeDamage is not get damage from teammate more if "mp_friendlyfire" is "0"
g_fDamage[attacker][id] += flDamage;
if(!g_iAssist[id] && g_fDamage[attacker][id] >= 50.0)
g_iAssist[id] = attacker;
}
public fwdPlayerKilledPost(const id, attacker)
{
if(id != attacker && attacker != g_iAssist[id] && is_user_connected(g_iAssist[id]))
{
rg_add_account(g_iAssist[id], MONEY);
#if defined SUPPORT_CSSTATS_MYSQL
csstats_set_user_value(id, 0, csstats_get_user_value(id, 0) + 1);
#endif
new iFrags = get_user_frags(g_iAssist[id]) + 1;
set_entvar(g_iAssist[id], var_frags, float(iFrags));
message_begin(MSG_ALL, g_msgScoreInfo);
write_byte(g_iAssist[id]);
write_short(iFrags);
write_short(get_member(g_iAssist[id], m_iDeaths));
write_short(0);
write_short(get_member(g_iAssist[id], m_iTeam));
message_end();
new killer[32], victim[32];
if(is_user_connected(attacker))
get_user_name(attacker, killer, charsmax(killer))
else formatex(killer, charsmax(killer), "Killer unknown");
get_user_name(id, victim, charsmax(victim));
ChatColor(g_iAssist[id], "^1[^4Assist^1] ^4Вы помогли ^3%s ^4убить ^3%s^4. Вам бонус ^1-^3 1 фраг ^1+^3 300$", killer, victim);
ResetAssist(id);
}
}
ResetAssist(id)
{
g_iAssist[id] = 0;
arrayset(_:g_fDamage[id], _:0.0, sizeof g_fDamage[]);
}
stock ChatColor(id, const szMessage[], any:...)
{
static szMsg[190]; vformat(szMsg, charsmax(szMsg), szMessage, 3);
message_begin(MSG_ONE, 76, .player = id);
write_byte(id);
write_string(szMsg);
message_end();
}
Помогите решить
В этой теме было размещено решение! Перейти к решению.