#include <sourcemod>
#include <client>
#include <msg>
#include <cstrike>
#include <hamsandwich>
#include <string>
#include <array>
new TeamName[4][20] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
};
new __dhud_color;
new __dhud_x;
new __dhud_y;
new __dhud_effect;
new __dhud_fxtime;
new __dhud_holdtime;
new __dhud_fadeintime;
new __dhud_fadeouttime;
new __dhud_reliable;
new filename[16] = "killzmrules.txt";
new filenamevip[18] = "kilzmvipinfo.txt";
user_silentkill(index)
{
static msgid;
new msgblock;
if (!msgid)
{
msgid = get_user_msgid("DeathMsg");
}
msgblock = get_msg_block(msgid);
set_msg_block(msgid, 1);
user_kill(index, 1);
set_msg_block(msgid, msgblock);
return 1;
}
public __fatal_ham_error(Ham:id, HamError:err, reason[])
{
new func = get_func_id("HamFilter", -1);
new bool:fail = true;
if (func != -1 && callfunc_begin_i(func, -1) == 1)
{
callfunc_push_int(id);
callfunc_push_int(err);
callfunc_push_str(reason, 0);
if (callfunc_end() == 1)
{
fail = false;
}
}
if (fail)
{
set_fail_state(reason);
}
return 0;
}
ColorChat(id, Color:type, msg[])
{
new message[256];
switch (type)
{
case 1:
message[0] = 1;
break;
case 2:
message[0] = 4;
break;
default:
message[0] = 3;
break;
}
vformat(message[1], 251, msg, "DeathMsg");
message[192] = 0;
new team;
new ColorChange;
new index;
new MSG_Type;
if (id)
{
MSG_Type = 8;
index = id;
}
else
{
index = FindPlayer();
MSG_Type = 0;
}
team = get_user_team(index, {0}, 0);
ColorChange = ColorSelection(index, MSG_Type, type);
ShowColorMessage(index, MSG_Type, message);
if (ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
return 0;
}
ShowColorMessage(id, type, message[])
{
static msgSayText;
if (!msgSayText)
{
msgSayText = get_user_msgid("SayText");
}
message_begin(type, msgSayText, 232, id);
write_byte(id);
write_string(message);
message_end();
return 0;
}
Team_Info(id, type, team[])
{
static msgTeamInfo;
if (!msgTeamInfo)
{
msgTeamInfo = get_user_msgid("TeamInfo");
}
message_begin(type, msgTeamInfo, 232, id);
write_byte(id);
write_string(team);
message_end();
return 1;
}
ColorSelection(index, type, Color:Type)
{
switch (Type)
{
case 4:
return Team_Info(index, type, TeamName[0]);
case 5:
return Team_Info(index, type, TeamName[1]);
case 6:
return Team_Info(index, type, TeamName[2]);
default:
return 0;
}
}
FindPlayer()
{
new i = 1; // Начинаем с 1, так как 0 - это 'нулевой' игрок
while (i <= get_maxplayers())
{
if (is_user_connected(i))
{
return i;
}
i++;
}
return -1;
}
set_dhudmessage(red, green, blue, Float:x, Float:y, effects, Float:fxtime, Float:holdtime, Float:fadeintime, Float:fadeouttime, bool:reliable)
{
__dhud_color = clamp(red, 0, 255) << 16 + clamp(green, 0, 255) << 8 + clamp(blue, 0, 255);
__dhud_x = x;
__dhud_y = y;
__dhud_effect = effects;
__dhud_fxtime = fxtime;
__dhud_holdtime = holdtime;
__dhud_fadeintime = fadeintime;
__dhud_fadeouttime = fadeouttime;
__dhud_reliable = reliable;
return 1;
}
show_dhudmessage(index, message[])
{
new buffer[128];
new numArguments = numargs();
if (numArguments == 2)
{
send_dhudMessage(index, message);
}
else
{
new var1;
if (index || numArguments == 3)
{
vformat(buffer, 127, message, "");
send_dhudMessage(index, buffer);
}
new playersList[32];
new numPlayers;
get_players(playersList, numPlayers, "ch", 332);
if (!numPlayers)
{
return 0;
}
new Array:handleArrayML
= ArrayCreate
(1, 32); new i = 2;
while (i < numArguments)
{
if (getarg(i, 0) == -1)
{
new j = 0;
while ((buffer[j] = getarg(i + 1, j)) != "")
{
j++;
}
if (GetLangTransKey(buffer) != -1)
{
i++;
ArrayPushCell(handleArrayML, i);
}
}
i++;
}
new size = ArraySize(handleArrayML);
if (!size)
{
vformat(buffer, 127, message, "");
send_dhudMessage(index, buffer);
}
else
{
for (new i = 0; i < numPlayers; i++)
{
index = playersList[i];
for (new j = 0; j < size; j++)
{
setarg(ArrayGetCell(handleArrayML, j), 0, index);
}
vformat(buffer, 127, message, "");
send_dhudMessage(index, buffer);
}
}
ArrayDestroy(handleArrayML);
}
return 1;
}
send_dhudMessage(index, message[])
{
new var2;
if (__dhud_reliable)
{
var2 = index ? 1 : 2;
}
else
{
var2 = index ? 8 : 0;
}
message_begin(var2, 51, 232, index);
write_byte
(strlen(message
) + 31); // Длина сообщения write_byte(6); // Тип сообщения
write_byte(__dhud_effect);
write_long(__dhud_color);
write_long(__dhud_x);
write_long(__dhud_y);
write_long(__dhud_fadeintime);
write_long(__dhud_fadeouttime);
write_long(__dhud_holdtime);
write_long(__dhud_fxtime);
write_string(message);
message_end();
return 0;
}
public plugin_init()
{
register_plugin("ZM VIP HPM", "1.0", "P.K.");
RegisterHam(0, "player", "player_spawn", 1);
register_clcmd("say /server", "serverip", -1, 716, -1);
register_clcmd("say /servers", "serverip", -1, 716, -1);
register_clcmd("say /ip", "serverip", -1, 716, -1);
register_clcmd("say /rules", "cmdZMRules", -1, 716, -1);
register_clcmd("say /spec", "cmdSpec", -1, 716, -1);
register_clcmd("chooseteam", "cmdZMvipInfo", -1, 716, -1);
register_clcmd("jointeam", "cmdZMvipInfo", -1, 716, -1);
register_concmd("meta list", "Fuuu", -1, 1280, -1);
register_message(get_user_msgid("Health"), "message_Health");
set_task(1092616192, "ShowHuddead", 987, 1428, 0, 1420, 0);
return 0;
}
public ShowHuddead()
{
new iRed = random_num(150, 255);
new iGreen = random_num(150, 255);
new iBlue = random_num(150, 255);
new Players[32];
new playerCount;
new player;
get_players(Players, playerCount, "bch", 332);
for (new i = 0; i < playerCount; i++)
{
player = Players[i];
set_dhudmessage(iRed, iGreen, iBlue, -1.0, 0.0, 0, 5.0, 10.0, 0.0, 1.0, false);
show_dhudmessage(player, "Для полной информации о сервере - посетите наш сайт!\nwww.KILLzm.net");
}
return 0;
}
public player_spawn(id)
{
if (is_user_alive(id) && get_user_flags(id, 0) & 4096) // проверка на флаг
{
set_user_health(id, 222);
cs_set_user_armor(id, 111, 2);
cs_set_user_money(id, 16000, 1);
}
return 0;
}
public Fuuu(id)
{
client_cmd(id, "clear");
return 0;
}
public cmdSpec(id)
{
if (is_user_alive(id) && get_user_flags(id, 0) & 4096)
{
ColorChat(id, Color:5, "\x03 *\x01 Не используйте эту команду, когда вы живы бродяга!\x03 :)");
return 1; // Прекращаем выполнение функции
}
if (cs_get_user_team(id, 0) == 3 && get_user_flags(id, 0) & 4096)
{
ColorChat(id, Color:4, "\x03 *\x01 Вы уже в\x03 Смотрителях");
return 1; // Прекращаем выполнение функции
}
else
{
if (!is_user_alive(id) && get_user_flags(id, 0) & 4096)
{
new namex[32];
get_user_name(id, namex, 31);
user_silentkill(id);
cs_set_user_team(id, "", 0);
ColorChat(0, Color:4, "\x01 *\x04 %s\x01 присоединился к\x03 Смотрителям", namex);
}
}
if (get_user_flags(id, 0) & 33554432)
{
ColorChat(id, Color:5, "\x04[\x03 ТОЛЬКО ДЛЯ VIP\x04 ]\x01 покупайте VIP аккаунт здесь:\x03 www.KILLzm.net");
}
return 0;
}
public client_impulse(id, impulse)
{
if (get_user_flags(id, 0) & 33554432 && impulse == 201) // Проверка на VIP
{
return 1; // Блокируем импульс
}
return 0;
}
public cmdZMvipInfo(id)
{
if (cs_get_user_team(id, 0) == 3 || cs_get_user_team(id, 0))
{
return 0; // Если игрок уже в команде или в зрителях, ничего не делаем
}
show_motd(id, filenamevip, "www.KILLzm.net - VIP Info!");
return 1;
}
public cmdZMRules(id)
{
show_motd(id, filename, "www.KILLzm.net - Rules!");
return 0;
}
public serverip(id)
{
ColorChat(0, Color:5, "\x04 *\x03 46.174.48.28:27777\x01 посещайте наш сайт:\x04 www.KILLzm.net");
return 0;
}
public message_Health(msgid, dest, id)
{
if (!is_user_alive(id))
{
return 0; // Если игрок мертв, не обрабатываем
}
static hp;
hp = get_msg_arg_int(1);
if (hp > 255 && hp % 256)
{
hp += 1; // Увеличиваем здоровье
set_msg_arg_int(1, 1, hp);
}
return 0;
}
I2luY2x1ZGUgPHNvdXJjZW1vZD4KI2luY2x1ZGUgPGNsaWVudD4KI2luY2x1Z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yBib29sOmZhaWwgPSB0cnVlOwoKICAgIGlmIChmdW5jICE9IC0xICYmIGNhbGxmdW5jX2JlZ2luX2koZnVuYywgLTEpID09IDEpCiAgICB7CiAgICAgICAgY2FsbGZ1bmNfcHVzaF9pbnQoaWQpOwogICAgICAgIGNhbGxmdW5jX3B1c2hfaW50KGVycik7CiAgICAgICAgY2FsbGZ1bmNfcHVzaF9zdHIocmVhc29uLCAwKTsKICAgICAgICBpZiAoY2FsbGZ1bmNfZW5kKCkgPT0gMSkKICAgICAgICB7CiAgICAgICAgICAgIGZhaWwgPSBmYWxzZTsKICAgICAgICB9CiAgICB9CgogICAgaWYgKGZhaWwpCiAgICB7CiAgICAgICAgc2V0X2ZhaWxfc3RhdGUocmVhc29uKTsKICAgIH0KICAgIHJldHVybiAwOwp9CgpDb2xvckNoYXQoaWQsIENvbG9yOnR5cGUsIG1zZ1tdKQp7CiAgICBuZXcgbWVzc2FnZVsyNTZdOwogICAgc3dpdGNoICh0eXBlKQogICAgewogICAgICAgIGNhc2UgMToKICAgICAgICAgICAgbWVzc2FnZVswXSA9IDE7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgMjoKICAgICAgICAgICAgbWVzc2FnZVswXSA9IDQ7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIG1lc3NhZ2VbMF0gPSAzOwogICAgICAgICAgICBicmVhazsKICAgIH0KICAgIHZmb3JtYXQobWVzc2FnZVsxXSwgMjUxLCBtc2csICJEZWF0aE1zZyIpOwogICAgbWVzc2FnZVsxOTJdID0gMDsKCiAgICBuZXcgdGVhbTsKICAgIG5ldyBDb2xvckNoYW5nZTsKICAgIG5ldyBpbmRleDsKICAgIG5ldyBNU0dfVHlwZTsKCiAgICBpZiAoaWQpCiAgICB7CiAgICAgICAgTVNHX1R5cGUgPSA4OwogICAgICAgIGluZGV4ID0gaWQ7CiAgICB9CiAgICBlbHNlCiAgICB7CiAgICAgICAgaW5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NTCA9IEFycmF5Q3JlYXRlKDEsIDMyKTsKICAgICAgICBuZXcgaSA9IDI7CgogICAgICAgIHdoaWxlIChpIDwgbnVtQXJndW1lbnRzKQogICAgICAgIHsKICAgICAgICAgICAgaWYgKGdldGFyZyhpLCAwKSA9PSAtMSkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgbmV3IGogPSAwOwogICAgICAgICAgICAgICAgd2hpbGUgKChidWZmZXJbal0gPSBnZXRhcmcoaSArIDEsIGopKSAhPSAiIikKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBqKys7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgaWYgKEdldExhbmdUcmFuc0tleShidWZmZXIpICE9IC0xKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIGkrKzsKICAgICAgICAgICAgICAgICAgICBBcnJheVB1c2hDZWxsKGhhbmRsZUFycmF5TUwsIGkpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGkrKzsKICAgICAgICB9CgogICAgICAgIG5ldyBzaXplID0gQXJyYXlTaXplKGhhbmRsZUFycmF5TUwpOwogICAgICAgIGlmICghc2l6ZSkKICAgICAgICB7CiAgICAgICAgICAgIHZmb3JtYXQoYnVmZmVyLCAxMjcsIG1lc3NhZ2UsICIiKTsKICAgICAgICAgICAgc2VuZF9kaHVkTWVzc2FnZShpbmRleCwgYnVmZmVyKTsKICAgICAgICB9CiAgICAgICAgZWxzZQogICAgICAgIHsKICAgICAgICAgICAgZm9yIChuZXcgaSA9IDA7IGkgPCBudW1QbGF5ZXJzOyBpKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGluZGV4ID0gcGxheWVyc0xpc3RbaV07CiAgICAgICAgICAgICAgICBmb3IgKG5ldyBqID0gMDsgaiA8IHNpemU7IGorKykKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBzZXRhcmcoQXJyYXlHZXRDZWxsKGhhbmRsZUFycmF5TUwsIGopLCAwLCBpbmRleCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB2Zm9ybWF0KGJ1ZmZlciwgMTI3LCBtZXNzYWdlLCAiIik7CiAgICAgICAgICAgICAgICBzZW5kX2RodWRNZXNzYWdlKGluZGV4LCBidWZmZXIpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIEFycmF5RGVzdHJveShoYW5kbGVBcnJheU1MKTsKICAgIH0KICAgIHJldHVybiAxOwp9CgpzZW5kX2RodWRNZXNzYWdlKGluZGV4LCBtZXNzYWdlW10pCnsKICAgIG5ldyB2YXIyOwogICAgCiAgICBpZiAoX19kaHVkX3JlbGlhYmxlKQogICAgewogICAgICAgIHZhcjIgPSBpbmRleCA/IDEgOiAyOwogICAgfQogICAgZWxzZQogICAgewogICAgICAgIHZhcjIgPSBpbmRleCA/IDggOiAwOwogICAgfQoKICAgIG1lc3NhZ2VfYmVnaW4odmFyMiwgNTEsIDIzMiwgaW5kZXgpOwogICAgd3JpdGVfYnl0ZShzdHJsZW4obWVzc2FnZSkgKyAzMSk7IC8vINCU0LvQuNC90LAg0YHQvtC+0LHRidC10L3QuNGPCiAgICB3cml0ZV9ieXRlKDYpOyAvLyDQotC40L8g0YHQvtC+0LHRidC10L3QuNGPCiAgICB3cml0ZV9ieXRlKF9fZGh1ZF9lZmZlY3QpOwogICAgd3JpdGVfbG9uZyhfX2RodWRfY29sb3IpOwogICAgd3JpdGVfbG9uZyhfX2RodWRfeCk7CiAgICB3cml0ZV9sb25nKF9fZGh1ZF95KTsKICAgIHdyaXRlX2xvbmcoX19kaHVkX2ZhZGVpbnRpbWUpOwogICAgd3JpdGVfbG9uZyhfX2RodWRfZmFkZW91dHRpbWUpOwogICAgd3JpdGVfbG9uZyhfX2RodWRfaG9sZHRpbWUpOwogICAgd3JpdGVfbG9uZyhfX2RodWRfZnh0aW1lKTsKICAgIHdyaXRlX3N0cmluZyhtZXNzYWdlKTsKICAgI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Ind3dy5LSUxMem0ubmV0IC0gVklQIEluZm8hIik7CiAgICByZXR1cm4gMTsKfQoKcHVibGljIGNtZFpNUnVsZXMoaWQpCnsKICAgIHNob3dfbW90ZChpZCwgZmlsZW5hbWUsICJ3d3cuS0lMTHptLm5ldCAtIFJ1bGVzISIpOwogICAgcmV0dXJuIDA7Cn0KCnB1YmxpYyBzZXJ2ZXJpcChpZCkKewogICAgQ29sb3JDaGF0KDAsIENvbG9yOjUsICJceDA0ICpceDAzIDQ2LjE3NC40OC4yODoyNzc3N1x4MDEg0L/QvtGB0LXRidCw0LnRgtC1INC90LDRiCDRgdCw0LnRgjpceDA0IHd3dy5LSUxMem0ubmV0Iik7CiAgICByZXR1cm4gMDsKfQoKcHVibGljIG1lc3NhZ2VfSGVhbHRoKG1zZ2lkLCBkZXN0LCBpZCkKewogICAgaWYgKCFpc191c2VyX2FsaXZlKGlkKSkKICAgIHsKICAgICAgICByZXR1cm4gMDsgLy8g0JXRgdC70Lgg0LjQs9GA0L7QuiDQvNC10YDRgtCyLCDQvdC1INC+0LHRgNCw0LHQsNGC0YvQstCw0LXQvAogICAgfQogICAgCiAgICBzdGF0aWMgaHA7CiAgICBocCA9IGdldF9tc2dfYXJnX2ludCgxKTsKICAgIGlmIChocCA+IDI1NSAmJiBocCAlIDI1NikKICAgIHsKICAgICAgICBocCArPSAxOyAvLyDQo9Cy0LXQu9C40YfQuNCy0LDQtdC8INC30LTQvtGA0L7QstGM0LUKICAgICAgICBzZXRfbXNnX2FyZ19pbnQoMSwgMSwgaHApOwogICAgfQogICAgcmV0dXJuIDA7Cn0K
#include <sourcemod>
#include <client>
#include <msg>
#include <cstrike>
#include <hamsandwich>
#include <string>
#include <array>
new TeamName[4][20] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
};
new __dhud_color;
new __dhud_x;
new __dhud_y;
new __dhud_effect;
new __dhud_fxtime;
new __dhud_holdtime;
new __dhud_fadeintime;
new __dhud_fadeouttime;
new __dhud_reliable;
new filename[16] = "killzmrules.txt";
new filenamevip[18] = "kilzmvipinfo.txt";
user_silentkill(index)
{
static msgid;
new msgblock;
if (!msgid)
{
msgid = get_user_msgid("DeathMsg");
}
msgblock = get_msg_block(msgid);
set_msg_block(msgid, 1);
user_kill(index, 1);
set_msg_block(msgid, msgblock);
return 1;
}
public __fatal_ham_error(Ham:id, HamError:err, reason[])
{
new func = get_func_id("HamFilter", -1);
new bool:fail = true;
if (func != -1 && callfunc_begin_i(func, -1) == 1)
{
callfunc_push_int(id);
callfunc_push_int(err);
callfunc_push_str(reason, 0);
if (callfunc_end() == 1)
{
fail = false;
}
}
if (fail)
{
set_fail_state(reason);
}
return 0;
}
ColorChat(id, Color:type, msg[])
{
new message[256];
switch (type)
{
case 1:
message[0] = 1;
break;
case 2:
message[0] = 4;
break;
default:
message[0] = 3;
break;
}
vformat(message[1], 251, msg, "DeathMsg");
message[192] = 0;
new team;
new ColorChange;
new index;
new MSG_Type;
if (id)
{
MSG_Type = 8;
index = id;
}
else
{
index = FindPlayer();
MSG_Type = 0;
}
team = get_user_team(index, {0}, 0);
ColorChange = ColorSelection(index, MSG_Type, type);
ShowColorMessage(index, MSG_Type, message);
if (ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
return 0;
}
ShowColorMessage(id, type, message[])
{
static msgSayText;
if (!msgSayText)
{
msgSayText = get_user_msgid("SayText");
}
message_begin(type, msgSayText, 232, id);
write_byte(id);
write_string(message);
message_end();
return 0;
}
Team_Info(id, type, team[])
{
static msgTeamInfo;
if (!msgTeamInfo)
{
msgTeamInfo = get_user_msgid("TeamInfo");
}
message_begin(type, msgTeamInfo, 232, id);
write_byte(id);
write_string(team);
message_end();
return 1;
}
ColorSelection(index, type, Color:Type)
{
switch (Type)
{
case 4:
return Team_Info(index, type, TeamName[0]);
case 5:
return Team_Info(index, type, TeamName[1]);
case 6:
return Team_Info(index, type, TeamName[2]);
default:
return 0;
}
}
FindPlayer()
{
new i = 1; // Начинаем с 1, так как 0 - это 'нулевой' игрок
while (i <= get_maxplayers())
{
if (is_user_connected(i))
{
return i;
}
i++;
}
return -1;
}
set_dhudmessage(red, green, blue, Float:x, Float:y, effects, Float:fxtime, Float:holdtime, Float:fadeintime, Float:fadeouttime, bool:reliable)
{
__dhud_color = clamp(red, 0, 255) << 16 + clamp(green, 0, 255) << 8 + clamp(blue, 0, 255);
__dhud_x = x;
__dhud_y = y;
__dhud_effect = effects;
__dhud_fxtime = fxtime;
__dhud_holdtime = holdtime;
__dhud_fadeintime = fadeintime;
__dhud_fadeouttime = fadeouttime;
__dhud_reliable = reliable;
return 1;
}
show_dhudmessage(index, message[])
{
new buffer[128];
new numArguments = numargs();
if (numArguments == 2)
{
send_dhudMessage(index, message);
}
else
{
new var1;
if (index || numArguments == 3)
{
vformat(buffer, 127, message, "");
send_dhudMessage(index, buffer);
}
new playersList[32];
new numPlayers;
get_players(playersList, numPlayers, "ch", 332);
if (!numPlayers)
{
return 0;
}
new Array:handleArrayML = ArrayCreate(1, 32);
new i = 2;
while (i < numArguments)
{
if (getarg(i, 0) == -1)
{
new j = 0;
while ((buffer[j] = getarg(i + 1, j)) != "")
{
j++;
}
if (GetLangTransKey(buffer) != -1)
{
i++;
ArrayPushCell(handleArrayML, i);
}
}
i++;
}
new size = ArraySize(handleArrayML);
if (!size)
{
vformat(buffer, 127, message, "");
send_dhudMessage(index, buffer);
}
else
{
for (new i = 0; i < numPlayers; i++)
{
index = playersList[i];
for (new j = 0; j < size; j++)
{
setarg(ArrayGetCell(handleArrayML, j), 0, index);
}
vformat(buffer, 127, message, "");
send_dhudMessage(index, buffer);
}
}
ArrayDestroy(handleArrayML);
}
return 1;
}
send_dhudMessage(index, message[])
{
new var2;
if (__dhud_reliable)
{
var2 = index ? 1 : 2;
}
else
{
var2 = index ? 8 : 0;
}
message_begin(var2, 51, 232, index);
write_byte(strlen(message) + 31); // Длина сообщения
write_byte(6); // Тип сообщения
write_byte(__dhud_effect);
write_long(__dhud_color);
write_long(__dhud_x);
write_long(__dhud_y);
write_long(__dhud_fadeintime);
write_long(__dhud_fadeouttime);
write_long(__dhud_holdtime);
write_long(__dhud_fxtime);
write_string(message);
message_end();
return 0;
}
public plugin_init()
{
register_plugin("ZM VIP HPM", "1.0", "P.K.");
RegisterHam(0, "player", "player_spawn", 1);
register_clcmd("say /server", "serverip", -1, 716, -1);
register_clcmd("say /servers", "serverip", -1, 716, -1);
register_clcmd("say /ip", "serverip", -1, 716, -1);
register_clcmd("say /rules", "cmdZMRules", -1, 716, -1);
register_clcmd("say /spec", "cmdSpec", -1, 716, -1);
register_clcmd("chooseteam", "cmdZMvipInfo", -1, 716, -1);
register_clcmd("jointeam", "cmdZMvipInfo", -1, 716, -1);
register_concmd("meta list", "Fuuu", -1, 1280, -1);
register_message(get_user_msgid("Health"), "message_Health");
set_task(1092616192, "ShowHuddead", 987, 1428, 0, 1420, 0);
return 0;
}
public ShowHuddead()
{
new iRed = random_num(150, 255);
new iGreen = random_num(150, 255);
new iBlue = random_num(150, 255);
new Players[32];
new playerCount;
new player;
get_players(Players, playerCount, "bch", 332);
for (new i = 0; i < playerCount; i++)
{
player = Players[i];
set_dhudmessage(iRed, iGreen, iBlue, -1.0, 0.0, 0, 5.0, 10.0, 0.0, 1.0, false);
show_dhudmessage(player, "Для полной информации о сервере - посетите наш сайт!\nwww.KILLzm.net");
}
return 0;
}
public player_spawn(id)
{
if (is_user_alive(id) && get_user_flags(id, 0) & 4096) // проверка на флаг
{
set_user_health(id, 222);
cs_set_user_armor(id, 111, 2);
cs_set_user_money(id, 16000, 1);
}
return 0;
}
public Fuuu(id)
{
client_cmd(id, "clear");
return 0;
}
public cmdSpec(id)
{
if (is_user_alive(id) && get_user_flags(id, 0) & 4096)
{
ColorChat(id, Color:5, "\x03 *\x01 Не используйте эту команду, когда вы живы бродяга!\x03 :)");
return 1; // Прекращаем выполнение функции
}
if (cs_get_user_team(id, 0) == 3 && get_user_flags(id, 0) & 4096)
{
ColorChat(id, Color:4, "\x03 *\x01 Вы уже в\x03 Смотрителях");
return 1; // Прекращаем выполнение функции
}
else
{
if (!is_user_alive(id) && get_user_flags(id, 0) & 4096)
{
new namex[32];
get_user_name(id, namex, 31);
user_silentkill(id);
cs_set_user_team(id, "", 0);
ColorChat(0, Color:4, "\x01 *\x04 %s\x01 присоединился к\x03 Смотрителям", namex);
}
}
if (get_user_flags(id, 0) & 33554432)
{
ColorChat(id, Color:5, "\x04[\x03 ТОЛЬКО ДЛЯ VIP\x04 ]\x01 покупайте VIP аккаунт здесь:\x03 www.KILLzm.net");
}
return 0;
}
public client_impulse(id, impulse)
{
if (get_user_flags(id, 0) & 33554432 && impulse == 201) // Проверка на VIP
{
return 1; // Блокируем импульс
}
return 0;
}
public cmdZMvipInfo(id)
{
if (cs_get_user_team(id, 0) == 3 || cs_get_user_team(id, 0))
{
return 0; // Если игрок уже в команде или в зрителях, ничего не делаем
}
show_motd(id, filenamevip, "www.KILLzm.net - VIP Info!");
return 1;
}
public cmdZMRules(id)
{
show_motd(id, filename, "www.KILLzm.net - Rules!");
return 0;
}
public serverip(id)
{
ColorChat(0, Color:5, "\x04 *\x03 46.174.48.28:27777\x01 посещайте наш сайт:\x04 www.KILLzm.net");
return 0;
}
public message_Health(msgid, dest, id)
{
if (!is_user_alive(id))
{
return 0; // Если игрок мертв, не обрабатываем
}
static hp;
hp = get_msg_arg_int(1);
if (hp > 255 && hp % 256)
{
hp += 1; // Увеличиваем здоровье
set_msg_arg_int(1, 1, hp);
}
return 0;
}