Скриптер
Проверенный
Пользователь
- Сообщения
- 3,582
- Реакции
- 1,569
- Помог
- 137 раз(а)
Это не для чатаТак же нет никакой инфы в чате!
mp_deathmsg_flags "abc"
Это не для чатаТак же нет никакой инфы в чате!
mp_deathmsg_flags "abc"
It doesn't work properly.Alexs, does religion not allow you to move up a couple of messages?
Kvar anti-flash works fine.
а где выводится эта инфа?Это не для чата
Так же нет никакой инфы в чате!
mp_deathmsg_flags "abc"
#include <amxmodx>
#include <amxmisc>
// Flags for specifying extra info about player death
enum _: DeathMsg_ExtraFlags {
// float[3]
// Position where the victim was killed by the enemy
PLAYERDEATH_POSITION = 0x001,
// byte
// Index of the assistant who helped the attacker kill the victim
PLAYERDEATH_ASSISTANT = 0x002,
// short
// Bitsum classification for the rarity of the kill
// See enum KillRarity for details
PLAYERDEATH_KILLRARITY = 0x004,
}
// Classifying various player kill methods in the game
enum _: KillRarity {
KILLRARITY_HEADSHOT = 0x001, // Headshot
KILLRARITY_KILLER_BLIND = 0x002, // Killer was blind
KILLRARITY_NOSCOPE = 0x004, // No-scope sniper rifle kill
KILLRARITY_PENETRATED = 0x008, // Penetrated kill (through walls)
KILLRARITY_THRUSMOKE = 0x010, // Smoke grenade penetration kill (bullets went through smoke)
KILLRARITY_ASSISTEDFLASH = 0x020, // Assister helped with a flash
KILLRARITY_DOMINATION_BEGAN = 0x040, // Killer player began dominating the victim (NOTE: this flag is set once)
KILLRARITY_DOMINATION = 0x080, // Continues domination by the killer
KILLRARITY_REVENGE = 0x100 // Revenge by the killer
}
public plugin_init() {
register_plugin("DeathMsg ex annoucer", "1.0.0", "Dev-CS")
if (!is_running("cstrike"))
set_fail_state("Plugin works only with cstrike!")
register_event_ex("DeathMsg", "Message_DeathMsg", RegisterEvent_Global /*, "5>0" condition doesn't works! */)
}
public Message_DeathMsg(value) {
enum {
arg_killer = 1, arg_victim, arg_isHeadshot, arg_weaponName,
}
#pragma unused arg_isHeadshot, arg_weaponName
new iArg = 5 // start argument pos to read extra info
if (read_datanum() <= iArg)
return
new killer = read_data(arg_killer)
new victim = read_data(arg_victim)
new flags = read_data(iArg++)
if (!flags)
return
// if PLAYERDEATH_POSITION present, then skip coordinates
if (flags & PLAYERDEATH_POSITION)
iArg += 3
new assistant
if (flags & PLAYERDEATH_ASSISTANT)
assistant = read_data(iArg++)
new killRarity
if (flags & PLAYERDEATH_KILLRARITY)
killRarity = read_data(iArg++)
new message[192]
if (assistant) {
strcat(message, fmt("^3%n^1 assist to ", assistant), charsmax(message))
}
strcat(message, fmt("^3%n^1 kill ^3%n^1", killer, victim), charsmax(message))
if (killRarity) {
new rarityString[128]
if (BuildRarityString(killRarity, rarityString, charsmax(rarityString))) {
strcat(message, fmt(" (^4%s^1)", rarityString), charsmax(message))
}
}
client_print_color(0, print_team_red, message)
}
BuildRarityString(const bitKillRarity, buffer[], const len) {
if (!bitKillRarity)
return false
if (bitKillRarity & KILLRARITY_HEADSHOT) strcat(buffer, "HS ", len)
if (bitKillRarity & KILLRARITY_KILLER_BLIND) strcat(buffer, "Blind ", len)
if (bitKillRarity & KILLRARITY_NOSCOPE) strcat(buffer, "NoScope ", len)
if (bitKillRarity & KILLRARITY_PENETRATED) strcat(buffer, "Wallbang ", len)
if (bitKillRarity & KILLRARITY_THRUSMOKE) strcat(buffer, "ThruSmoke ", len)
// etc..
trim(buffer)
return strlen(buffer)
}
Почему бы сразу не?register_plugin("DeathMsg ex annoucer", "1.0.0", "Dev-CS")
Потому что истинный автор Vaqtincha, у него украли кодПочему бы сразу не?
register_plugin("DeathMsg ex annoucer", "1.0.0", "wopox")
Значит от тебя поддержки не будет?fl0wer, сука выше посмотри файл код от сайлента. Ты был дермом и дермом осталсяOneni ske jalapdi bolasi qo'taq 3 Янв 2024
new message[192]
, краша не будет при отправки?
client_print_color(0, print_team_red, message)
This is pretty nice.C++:#include <amxmodx> #include <amxmisc> // Flags for specifying extra info about player death enum _: DeathMsg_ExtraFlags { // float[3] // Position where the victim was killed by the enemy PLAYERDEATH_POSITION = 0x001, // byte // Index of the assistant who helped the attacker kill the victim PLAYERDEATH_ASSISTANT = 0x002, // short // Bitsum classification for the rarity of the kill // See enum KillRarity for details PLAYERDEATH_KILLRARITY = 0x004, } // Classifying various player kill methods in the game enum _: KillRarity { KILLRARITY_HEADSHOT = 0x001, // Headshot KILLRARITY_KILLER_BLIND = 0x002, // Killer was blind KILLRARITY_NOSCOPE = 0x004, // No-scope sniper rifle kill KILLRARITY_PENETRATED = 0x008, // Penetrated kill (through walls) KILLRARITY_THRUSMOKE = 0x010, // Smoke grenade penetration kill (bullets went through smoke) KILLRARITY_ASSISTEDFLASH = 0x020, // Assister helped with a flash KILLRARITY_DOMINATION_BEGAN = 0x040, // Killer player began dominating the victim (NOTE: this flag is set once) KILLRARITY_DOMINATION = 0x080, // Continues domination by the killer KILLRARITY_REVENGE = 0x100 // Revenge by the killer } public plugin_init() { register_plugin("DeathMsg ex annoucer", "1.0.0", "Dev-CS") if (!is_running("cstrike")) set_fail_state("Plugin works only with cstrike!") register_event_ex("DeathMsg", "Message_DeathMsg", RegisterEvent_Global /*, "5>0" condition doesn't works! */) } public Message_DeathMsg(value) { enum { arg_killer = 1, arg_victim, arg_isHeadshot, arg_weaponName, } #pragma unused arg_isHeadshot, arg_weaponName new iArg = 5 // start argument pos to read extra info if (read_datanum() <= iArg) return new killer = read_data(arg_killer) new victim = read_data(arg_victim) new flags = read_data(iArg++) if (!flags) return // if PLAYERDEATH_POSITION present, then skip coordinates if (flags & PLAYERDEATH_POSITION) iArg += 3 new assistant if (flags & PLAYERDEATH_ASSISTANT) assistant = read_data(iArg++) new killRarity if (flags & PLAYERDEATH_KILLRARITY) killRarity = read_data(iArg++) new message[192] if (assistant) { strcat(message, fmt("^3%n^1 assist to ", assistant), charsmax(message)) } strcat(message, fmt("^3%n^1 kill ^3%n^1", killer, victim), charsmax(message)) if (killRarity) { new rarityString[128] if (BuildRarityString(killRarity, rarityString, charsmax(rarityString))) { strcat(message, fmt(" (^4%s^1)", rarityString), charsmax(message)) } } client_print_color(0, print_team_red, message) } BuildRarityString(const bitKillRarity, buffer[], const len) { if (!bitKillRarity) return false if (bitKillRarity & KILLRARITY_HEADSHOT) strcat(buffer, "HS ", len) if (bitKillRarity & KILLRARITY_KILLER_BLIND) strcat(buffer, "Blind ", len) if (bitKillRarity & KILLRARITY_NOSCOPE) strcat(buffer, "NoScope ", len) if (bitKillRarity & KILLRARITY_PENETRATED) strcat(buffer, "Wallbang ", len) if (bitKillRarity & KILLRARITY_THRUSMOKE) strcat(buffer, "ThruSmoke ", len) // etc.. trim(buffer) return strlen(buffer) }
There will not gonna be crash, you can increase bufferBiZaJe, I’ll be at home, I’ll check it out for fun, there was just a crash somewhere when sending 191 or 192