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

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

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

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

Помогите в плагин поставить флаг доступа админа (Флаг "С")

Статус пользователя Andris1446
сообщение 4.1.2013, 10:03
Сообщение #1
Стаж: 13 лет

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

!
Предупреждение:
Andris1446,
Исходник в и под и подробнее опиши, что куда </andrewz>



#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

// ------------------------------------
new const PLUGIN[] = "No Fall Death"
#define VERSION "1.0"
// ------------------------------------

#define RANDOM_MIN_VALUE 1.0
#define REGENERATE_MIN_VALUE 1.0

new Float: Health[ 33 ];

new toggle_plugin, toggle_interval, toggle_amount;
new p_plugin, p_int, p_amount;
new g_msghealth;

public plugin_init()
{
register_plugin( PLUGIN, VERSION, "anakin_cstrike" );

register_logevent( "roundstart", 2, "1=Round_Start" );
RegisterHam( Ham_TakeDamage, "player", "ham_damage" );

toggle_plugin = register_cvar( "nfd_plugin", "1" );
toggle_interval = register_cvar( "nfd_interval", "5" );
toggle_amount = register_cvar( "ndf_amount", "3" );

g_msghealth = get_user_msgid( "Health" );
}
public roundstart()
{
p_plugin = get_pcvar_num( toggle_plugin );
p_int = get_pcvar_num( toggle_interval );
p_amount = get_pcvar_num( toggle_amount );
}

public ham_damage( this, inflictor, attacker, Float:damage, damagebits )
{
if( !p_plugin )
return FMRES_IGNORED;
if( !( damagebits & DMG_FALL ) )
return HAM_IGNORED;

if( task_exists( this+123 ) )
remove_task( this+123 );

pev( this, pev_health, Health[ this ] );

switch( p_plugin )
{
case 1: return HAM_SUPERCEDE;
case 2:
{
if( Check( damage, Health[ this ] ) )
{
SetHealth( this, random_float( RANDOM_MIN_VALUE, Health[ this ] ) );
return HAM_SUPERCEDE;
}
}
case 3:
{
if( Check( damage, Health[ this ] ) )
{
if( task_exists( this+123 ) )
remove_task( this+123 );

SetHealth( this, REGENERATE_MIN_VALUE );
set_task( float( p_int ), "give", this+123, _, _, "b" );

return HAM_SUPERCEDE;
}
}
}

return HAM_IGNORED;
}

public give( index )
{
index -= 123;

new Float: hp;
pev( index, pev_health, hp );

new Float: total = hp + float( p_amount );
SetHealth( index, total );

if( hp >= Health[ index ] )
{
SetHealth( index, Health[ index ] );
remove_task( index );
return 0;
}

return 0;
}

SetHealth( index, Float: hp )
{
message_begin( MSG_ONE, g_msghealth, {0,0,0}, index );
write_byte( floatround( hp ) );
message_end();

set_pev( index, pev_health, hp );
}

bool: Check( Float:value, Float:compare )
return ( value >= compare ) ? true : false;





Этот плагин при падении с высоты не снимает хп.
Я хочу чтоб только у админов с флагом "С" была такая возможность.
Заранее спасибо!

Отредактировал: AndrewZ, - 4.1.2013, 10:12
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя AndrewZ
сообщение 4.1.2013, 10:28
Сообщение #2


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

Стаж: 18 лет
Город: Санкт-Петербург


Сообщений: 4700
Благодарностей: 2452
Полезность: 1018

оформишь нормально (если конечно получится) - открою тему.


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