Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

> Правила раздела

Перед созданием новой темы убедитесь, не искал ли кто-нибудь подобный плагин до вас, для этого следует воспользоваться поиском.

Все вновь созданные темы, с названием типа "Помогите найти", "А что это за плагин", "Ищу плагин", "Нужен плагин", "Подскажите пожалуйста название плагина" - будут удалены.
При создании темы постарайтесь максимально понятно сформулировать её заголовок так, чтобы он соответствовал функциям плагина который Вы ищите. В том случае, если Вам не удается сформулировать мысль и правильно расписать всё в теме, воспользуйтесь графическим редактором, к примеру Paint, что бы примерно изобразить функции нужного Вам плагина.

Помогите с плагином

Статус пользователя ACbKA
сообщение 1.2.2014, 9:45
Сообщение #1


Стаж: 13 лет

Сообщений: 144
Благодарностей: 20
Полезность: < 0

Всем привет. Помогите с плагином, мне нужно чтобы цвет был белый!!!

Исходник:
Код:
#include <amxmodx>

#define PLUGIN "Kills Counter"
#define VERSION "1.0"
#define AUTHOR "Safety1st"

#define MAX_PLAYERS 32

new gMsgStatusIcon
new giCurrentKills[MAX_PLAYERS + 1]

public plugin_init() {
register_plugin( PLUGIN, VERSION, AUTHOR )
gMsgStatusIcon = get_user_msgid( "StatusIcon" )
register_event( "DeathMsg", "EventDeath", "a" )
register_event( "ResetHUD", "PlayerSpawn", "b" )
}

public PlayerSpawn(id) {
// reset frags quantity
ProcessDigit( id, .reset = true )
}

public client_disconnect(id) {
giCurrentKills[id] = 0
}

public EventDeath() {
new iKiller = read_data(1)
new iVictim = read_data(2)

if ( iKiller && is_user_connected(iKiller) && iKiller != iVictim ) {
if ( giCurrentKills[iKiller] < 9 ) // don't process if limit of 9 is reached
ProcessDigit( iKiller )
}
}

ProcessDigit( id, bool:reset = false ) {
static szSpriteNames[][] = {
"number_0",
"number_1",
"number_2",
"number_3",
"number_4",
"number_5",
"number_6",
"number_7",
"number_8",
"number_9"
}

// set digits color
static iColor[3] = {
0, // red
160, // green
0 // blue
}

// hide current digit
if ( giCurrentKills[id] ) { // hiding doesn't needed if there was 0 frags
message_begin( MSG_ONE_UNRELIABLE, gMsgStatusIcon, _, id )
write_byte(0) // status: 0 - off, 1 - on, 2 - flash
write_string( szSpriteNames[ giCurrentKills[id] ] ) // sprite name
message_end()
}

if ( reset ) {
giCurrentKills[id] = 0
return
}

// show new digit
message_begin( MSG_ONE_UNRELIABLE, gMsgStatusIcon, _, id )
write_byte( 1 ) // status: 0 - off, 1 - on, 2 - flash
write_string( szSpriteNames[ ++giCurrentKills[id] ] ) // sprite name
write_byte( iColor[0] )
write_byte( iColor[1] )
write_byte( iColor[2] )
message_end()
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Esecman
сообщение 1.2.2014, 9:47
Сообщение #2
Стаж: 12 лет

Сообщений: 945
Благодарностей: 208
Полезность: 0

Код:
#include <amxmodx>

#define PLUGIN "Kills Counter"
#define VERSION "1.0"
#define AUTHOR "Safety1st"

#define MAX_PLAYERS 32

new gMsgStatusIcon
new giCurrentKills[MAX_PLAYERS + 1]

public plugin_init() {
register_plugin( PLUGIN, VERSION, AUTHOR )
gMsgStatusIcon = get_user_msgid( "StatusIcon" )
register_event( "DeathMsg", "EventDeath", "a" )
register_event( "ResetHUD", "PlayerSpawn", "b" )
}

public PlayerSpawn(id) {
// reset frags quantity
ProcessDigit( id, .reset = true )
}

public client_disconnect(id) {
giCurrentKills[id] = 0
}

public EventDeath() {
new iKiller = read_data(1)
new iVictim = read_data(2)

if ( iKiller && is_user_connected(iKiller) && iKiller != iVictim ) {
if ( giCurrentKills[iKiller] < 9 ) // don't process if limit of 9 is reached
ProcessDigit( iKiller )
}
}

ProcessDigit( id, bool:reset = false ) {
static szSpriteNames[][] = {
"number_0",
"number_1",
"number_2",
"number_3",
"number_4",
"number_5",
"number_6",
"number_7",
"number_8",
"number_9"
}

// set digits color
static iColor[3] = {
255, //
255, //
255 // white
}

// hide current digit
if ( giCurrentKills[id] ) { // hiding doesn't needed if there was 0 frags
message_begin( MSG_ONE_UNRELIABLE, gMsgStatusIcon, _, id )
write_byte(0) // status: 0 - off, 1 - on, 2 - flash
write_string( szSpriteNames[ giCurrentKills[id] ] ) // sprite name
message_end()
}

if ( reset ) {
giCurrentKills[id] = 0
return
}

// show new digit
message_begin( MSG_ONE_UNRELIABLE, gMsgStatusIcon, _, id )
write_byte( 1 ) // status: 0 - off, 1 - on, 2 - flash
write_string( szSpriteNames[ ++giCurrentKills[id] ] ) // sprite name
write_byte( iColor[0] )
write_byte( iColor[1] )
write_byte( iColor[2] )
message_end()
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Sky Cat
сообщение 1.2.2014, 15:50
Сообщение #3
Стаж: 13 лет
Город: Белгород

Сообщений: 1179
Благодарностей: 734
Полезность: 1056

Все вновь созданные темы, с названием типа "Помогите найти", "А что это за плагин", "Ищю плагин", "Нужен плагин", "Подскажите пожалуйста название плагина" - будут удалены.

Выдал устное предупреждение


я знаю, что я ничего не знаю
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
  Ответить в данную темуНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: