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

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

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

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

Нужно вырезать из плагина

Статус пользователя Dreandy
сообщение 1.2.2014, 11:43
Сообщение #1
Стаж: 12 лет

Сообщений: 1394
Благодарностей: 231
Полезность: 37

Привет всем. Нужно вырезать из плагина * при попадании по противнику. Оставить синий экран при убийстве и kill icon.


sma
Код:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <dhudmessage>
#include <fakemeta>
#include <cstrike>

#define PLUGIN "Amx_Killer"
#define VERSION "1.1"
#define AUTHOR "Xhonor"
#pragma tabsize 0

#define ICON_SHOW 1
#define ICON_HIDE 0

new kill_num[33]
new gMsgID

public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR );

register_event( "DeathMsg", "hook_death", "a", "1>0" )
RegisterHam( Ham_TakeDamage,"player","damager",0 )

RegisterHam(Ham_Killed, "player", "ham_PlayerKilled")
RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawned_Post", 1);

gMsgID = get_user_msgid("StatusIcon")
}

public ham_PlayerSpawned_Post(id)
{
if (is_user_alive(id))
{
ammo_hud(id, 0)
kill_num[id] = 0
ammo_hud(id, 1)
}
}

public ham_PlayerKilled(victim, attacker)
{
static selfkill;

selfkill = (victim == attacker || !is_user_connected(attacker)) ? true : false;

if(!selfkill)
{
ammo_hud(attacker, 0)
kill_num[attacker] += 1
ammo_hud(attacker, 1)
}
}

ammo_hud(id, sw)
{
if(is_user_bot(id) || !is_user_alive(id))
return

new s_sprite[33]
format(s_sprite, 32, "number_%d", kill_num[id])
if(sw && is_user_alive(id))
{
message_begin( MSG_ONE, gMsgID, {0,0,0}, id )
write_byte( ICON_SHOW )
write_string( s_sprite )
write_byte( 30 )
write_byte( 144 )
write_byte( 255 )
message_end()
} else {
message_begin( MSG_ONE, gMsgID, {0,0,0}, id )
write_byte( ICON_HIDE )
write_string( s_sprite )
write_byte( 30 )
write_byte( 144 )
write_byte( 255 )
message_end()
}

if(kill_num[id] <= 0 && is_user_alive(id))
{
message_begin( MSG_ONE, gMsgID, {0,0,0}, id )
write_byte( ICON_HIDE )
write_string( s_sprite )
write_byte( 30 )
write_byte( 144 )
write_byte( 255 )
message_end()
}
}

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

if(is_user_alive(iKiller))
{
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, iKiller)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(30)
write_byte(144)
write_byte(255)
write_byte(75)
message_end()
}
new s_sprite[33]
format(s_sprite, 32, "number_%d", kill_num[iVictim])

message_begin( MSG_ONE, gMsgID, {0,0,0}, iVictim )
write_byte( ICON_HIDE )
write_string( s_sprite )
write_byte( 30 )
write_byte( 144 )
write_byte( 255 )
message_end()
}

public damager(victim, inflicator, attacker, Float:damage)
{
if(!is_user_connected(attacker))
return;

if(victim == attacker || !victim)
return;

if(is_user_alive(attacker))
{
if(damage > 0)
{
if(!is_user_connected(victim) || (cs_get_user_team(attacker) == cs_get_user_team(victim)))
return;

set_dhudmessage(30, 144, 255, -0.49, -0.51, 0, 0.01, 0.01)
show_dhudmessage(attacker, " * ")
}
}
}


критика - это лучший способ изменить человека
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя Legenda
сообщение 1.2.2014, 11:45
Сообщение #2


Иконка группы

Стаж: 16 лет

Сообщений: 3619
Благодарностей: 1706
Полезность: 1010

Меценат Меценат

удалить
Код:

public damager(victim, inflicator, attacker, Float:damage)
{
if(!is_user_connected(attacker))
return;

if(victim == attacker || !victim)
return;

if(is_user_alive(attacker))
{
if(damage > 0)
{
if(!is_user_connected(victim) || (cs_get_user_team(attacker) == cs_get_user_team(victim)))
return;

set_dhudmessage(30, 144, 255, -0.49, -0.51, 0, 0.01, 0.01)
show_dhudmessage(attacker, " * ")
}
}
}


и в самом начале вырезать

Код
RegisterHam( Ham_TakeDamage,"player","damager",0 )
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Dreandy
сообщение 1.2.2014, 12:00
Сообщение #3
Стаж: 12 лет

Сообщений: 1394
Благодарностей: 231
Полезность: 37

Цитата(Legenda @ 1.2.2014, 12:45) *
удалить
Код:

public damager(victim, inflicator, attacker, Float:damage)
{
if(!is_user_connected(attacker))
return;

if(victim == attacker || !victim)
return;

if(is_user_alive(attacker))
{
if(damage > 0)
{
if(!is_user_connected(victim) || (cs_get_user_team(attacker) == cs_get_user_team(victim)))
return;

set_dhudmessage(30, 144, 255, -0.49, -0.51, 0, 0.01, 0.01)
show_dhudmessage(attacker, " * ")
}
}
}


и в самом начале вырезать

Код
RegisterHam( Ham_TakeDamage,"player","damager",0 )


Спасибо, работает. Можно тему закрывать.


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