Всем привет!
Ребята, ни у кого нету плагина Reset score на REAPI? Нужен простой, оптимизированный код. Без всяких сообщений. Просто обнуление.
shel писал(а): Юлия, меня кое кто просил вас не трогать, поэтому ваш пост я опускаю.
Модератор: Leonidddd
vladboss писал(а):set_entvar(id, var_frags, 0.0);
set_member(id, m_iDeaths, 0);
vladboss писал(а):Это и есть почти готовый код, вызов осталось добавить.
Вы должны зарегистрироваться, чтобы видеть ссылки.
#include <amxmodx>
#include <reapi>
public plugin_init()
{
register_plugin("RS", "1.0", "Lucky");
register_clcmd("say /rs", "RsCmd");
}
public RsCmd(id)
{
set_entvar(id, var_frags, 0.0);
set_member(id, m_iDeaths, 0);
}
const g_ScoreInfo_msgid = 85;
message_begin(MSG_ALL, g_ScoreInfo_msgid);
write_byte(0); // PlayerID
write_short(0); // Score
write_short(0); // Deaths
write_short(0); // ClassID
write_short(0); // TeamID
Subb98 писал(а):Добавьте, до plugin_init:
- Код: Выделить всё
const g_ScoreInfo_msgid = 85;
После set_member:
- Код: Выделить всё
message_begin(MSG_ALL, g_ScoreInfo_msgid);
write_byte(0); // PlayerID
write_short(0); // Score
write_short(0); // Deaths
write_short(0); // ClassID
write_short(0); // TeamID
#include <amxmodx>
#include <reapi>
const g_ScoreInfo_msgid = 85;
public plugin_init()
{
register_plugin("RS", "1.0", "Lucky");
register_clcmd("say /rs", "RsCmd");
}
public RsCmd(id)
{
set_entvar(id, var_frags, 0.0);
set_member(id, m_iDeaths, 0);
message_begin(MSG_ALL, g_ScoreInfo_msgid);
write_byte(0);
write_short(0);
write_short(0);
write_short(0);
write_short(0);
}
Subb98 писал(а):Добавьте в начало обработчика команды проверку:
- Код: Выделить всё
if(!is_user_connected(id)) return;
#include <amxmodx>
#include <reapi>
const g_ScoreInfo_msgid = 85;
public plugin_init()
{
register_plugin("RS", "1.0", "Lucky");
register_clcmd("say /rs", "RsCmd");
}
public RsCmd(id)
{
if(!is_user_connected(id)) return;
set_entvar(id, var_frags, 0.0);
set_member(id, m_iDeaths, 0);
message_begin(MSG_ALL, g_ScoreInfo_msgid);
write_byte(0);
write_short(0);
write_short(0);
write_short(0);
write_short(0);
}
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 2