gesk1995
Пользователь
- Регистрация
- 8 Июн 2017
- Сообщения
- 339
- Симпатии
- 12
- Пол
- Мужской
Помогите добавить блокировку за суицид ( суть такова что все привилегии даются при спавне , и допустим игрок выбрал деньги много раз пишет в концоль kill и таким способом делает себе много денег )
Блокировать команду kill через концоль это глупо ...
Блокировать команду kill через концоль это глупо ...
Код:
register_dictionary( "vip.txt" );
if ( engfunc( EngFunc_FindEntityByString, -1, "classname", "func_bomb_target" ) )
gbBombMap = true;
else if ( engfunc( EngFunc_FindEntityByString, -1, "classname", "info_bomb_target" ) )
gbBombMap = true;
}
public client_connect ( id )
{
if ( get_user_flags( id ) & VIP_ACCESS )
{
equipment_mode[ id ] = 0;
money_mode[ id ] = 0;
critical_mode[ id ] = 0;
soldier_mode[ id ] = 0;
heavy_mode[ id ] = 0;
medic_mode[ id ] = 0;
}
}
public client_disconnect ( id )
{
remove_task( id );
if ( get_user_flags( id ) & VIP_ACCESS )
{
equipment_mode[ id ] = 0;
money_mode[ id ] = 0;
critical_mode[ id ] = 0;
soldier_mode[ id ] = 0;
heavy_mode[ id ] = 0;
medic_mode[ id ] = 0;
}
}
public client_putinserver ( id )
{
if ( get_user_flags( id ) & VIP_ACCESS )
{
if ( get_pcvar_num( p_Join ) && g_iRoundCount > 1 )
{
new name[ 32 ];
get_user_name( id, name, 31 );
print_color( 0, id, 0, "%L", LANG_SERVER, "VIP_JOIN", name );
}
}
}
public event_ShowDamage ( id )
{
if ( p_Damage )
{
static attacker, damage;
attacker = get_user_attacker( id );
damage = read_data( 2 );
if ( g_showrecieved && ( get_user_flags( id ) & VIP_ACCESS ) )
{
set_hudmessage( 200, 20, 20, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1 );
ShowSyncHudMsg( id, g_hudmsg2, "%i^n", damage );
}
if ( is_user_connected( attacker ) )
{
switch( p_Damage )
{
case 1:
{
if ( is_user_alive( attacker ) && ( get_user_flags( attacker ) & VIP_ACCESS ) )
{
set_hudmessage( 34, 139, 34, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1 );
ShowSyncHudMsg( attacker, g_hudmsg1, "%i^n", damage );
}
}
case 2:
{
if ( is_user_alive( attacker ) && ( get_user_flags( attacker ) & VIP_ACCESS ) && fm_is_ent_visible( attacker, id ) )
{
set_hudmessage( 34, 139, 34, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1 );
ShowSyncHudMsg( attacker, g_hudmsg1, "%i^n", damage );
}
}
}
}
}
}
public player_TakeDamage ( VictimId, InflictorId, AttackerId, Float:damage, dmgbits )
{
if ( IsPlayer( AttackerId ) && critical_active[ AttackerId ] && cs_get_user_team( VictimId ) != cs_get_user_team( AttackerId ) && get_pcvar_num( p_CriticalChance ) > random( 100 ) )
{
if ( get_user_flags( AttackerId ) & VIP_ACCESS )
{
new Float:crit_damage = damage * get_pcvar_float( p_CriticalDamage );
SetHamParamFloat( 4, crit_damage );
new szVictim[ 32 ];
get_user_name( VictimId, szVictim, 31 );
print_color( AttackerId, AttackerId, 0, "%L", LANG_PLAYER, "VIP_CRITICAL_HIT", szVictim );
client_cmd( AttackerId, "spk silent/vip/player/critical" );
}
}
return HAM_IGNORED;
}
public event_PlayerHeal ( )
{
new iKiller = read_data( 1 );
new iVictim = read_data( 2 );
if ( get_user_flags( iKiller ) & VIP_ACCESS )
{
if ( soldier_active[ iKiller ] && cs_get_user_team( iVictim ) != cs_get_user_team( iKiller ) )
{
new MaxHp = get_pcvar_num( p_SoldierMaxHp );
new BonusHp = get_pcvar_num( p_SoldierKillHp );
new TotalHp = get_user_health( iKiller ) + BonusHp;
if ( TotalHp >= MaxHp )
{
set_user_health( iKiller, MaxHp );
print_color( iKiller, iKiller, 0, "%L", LANG_SERVER, "VIP_SOLDIER_MAX_HP", get_pcvar_num( p_SoldierMaxHp ) );
client_cmd( iKiller, "spk silent/vip/player/maximum" );
message_begin( MSG_ONE_UNRELIABLE, g_msgFade, .player=iKiller );
{
write_short( 1<<13 );
write_short( 1<<5 );
write_short( FFADE_IN );
write_byte( 139 );
write_byte( 34 );
write_byte( 34 );
write_byte( 75 );
}
message_end( );
message_begin( MSG_ONE_UNRELIABLE, g_msgShake, .player=iKiller );
{
write_short( 255<<7 );
write_short( 50<<7 );
write_short( 255<<7 );
}
message_end( );
} else {
set_user_health( iKiller, TotalHp );
print_color( iKiller, iKiller, 0, "%L", LANG_SERVER, "VIP_SOLDIER_HEAL", get_pcvar_num( p_SoldierKillHp ) );
client_cmd( iKiller, "spk silent/vip/items/health" );
message_begin( MSG_ONE_UNRELIABLE, g_msgFade, .player=iKiller );
{
write_short( 1<<12 );
write_short( 1<<5 );
write_short( FFADE_IN );
write_byte( 139 );
write_byte( 34 );
write_byte( 34 );
write_byte( 75 );
}
message_end( );
message_begin( MSG_ONE_UNRELIABLE, g_msgShake, .player=iKiller );
{
write_short( 255<<5 );
write_short( 50<<5 );
write_short( 255<<5 );
}
message_end( );
}
}
}
}
public player_Attack ( id, iAttacker, Float:flDamage, Float:fVecDir[3], tr )
{
if ( get_user_flags( id ) & VIP_ACCESS )
{
if ( IsPlayer( iAttacker ) && heavy_active[ id ] && cs_get_user_team( id ) != cs_get_user_team( iAttacker ) && get_tr2( tr, TR_iHitgroup ) == HIT_HEAD && get_tr2( tr, TR_iHitgroup ) == HIT_HEAD )
{
set_tr2( tr, TR_iHitgroup, HIT_CHEST );
set_tr2( tr, TR_iHitgroup, HIT_STOMACH );
client_cmd( id, "spk silent/vip/player/headshot" );
message_begin( MSG_ONE_UNRELIABLE, g_msgFade, .player=id );
{
write_short( 1<<12 );
write_short( 1<<5 );
write_short( FFADE_IN );
write_byte( 139 );
write_byte( 34 );
write_byte( 34 );
write_byte( 75 );
}
message_end( );
message_begin( MSG_ONE_UNRELIABLE, g_msgShake, .player=id );
{
write_short( 255<<5 );
write_short( 50<<5 );
write_short( 255<<5 );
}
message_end( );
}
}
}
public waiter ( id )
{
canHeal = false;
set_task( get_pcvar_float( p_MedicHpRegenSpeed ), "givehp", id );
}
public givehp ( id )
{
canHeal = true;
new MaxHp = get_pcvar_num( p_MedicMaxHp );
new BonusHp = get_pcvar_num( p_MedicHpRegen );
new TotalHp = get_user_health( id ) + BonusHp;
new hp = pev( id, pev_health );
if ( get_user_flags( id ) & VIP_ACCESS )
{
if ( medic_active[ id ] && is_user_alive( id ) && get_user_weapon( id ) == CSW_KNIFE )
{
if ( TotalHp >= MaxHp )
{
set_user_health( id, MaxHp );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_MEDIC_MAX_HP", get_pcvar_num( p_MedicMaxHp ) );
client_cmd( id, "spk silent/vip/player/maximum" );
message_begin( MSG_ONE_UNRELIABLE, g_msgFade, .player=id );
{
write_short( 1<<13 );
write_short( 1<<5 );
write_short( FFADE_IN );
write_byte( 134 );
write_byte( 34 );
write_byte( 34 );
write_byte( 75 );
}
message_end( );
message_begin( MSG_ONE_UNRELIABLE, g_msgShake, .player=id );
{
write_short( 255<<7 );
write_short( 50<<7 );
write_short( 255<<7 );
}
message_end( );
} else {
set_user_health( id, hp + BonusHp );
client_cmd( id, "spk silent/vip/items/health" );
message_begin( MSG_ONE_UNRELIABLE, g_msgFade, .player=id );
{
write_short( 1<<12 );
write_short( 1<<5 );
write_short( FFADE_IN );
write_byte( 134 );
write_byte( 34 );
write_byte( 34 );
write_byte( 75 );
}
message_end( );
message_begin( MSG_ONE_UNRELIABLE, g_msgShake, .player=id );
{
write_short( 255<<5 );
write_short( 50<<5 );
write_short( 255<<5 );
}
message_end( );
}
}
}
}
public pthink ( id )
{
if ( medic_active[ id ] )
{
if ( canHeal && ( pev( id, pev_health ) < 200) )
{
waiter( id );
}
}
return FMRES_HANDLED;
}
public show_vip_menu ( id )
{
if ( get_user_flags( id ) & VIP_ACCESS )
{
if ( !get_pcvar_num( p_Enabled ) )
{
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_MENU_DISSABLE" );
client_cmd( id, "spk silent/vip/noaccess" );
}
if ( get_pcvar_num( p_Enabled ) )
{
client_cmd( id, "spk silent/vip/menu/open" );
new menu = menu_create( " \rT vs CS - CSDM ^n\r[\yVipMenu\r] \wВип меню", "menu" );
if ( !equipment_mode[ id ] && get_pcvar_num( p_Equipment ) )
{
menu_additem( menu, "Все гранаты \d[\yHE, FB, SG\d]", "1", 0 );
}
else if ( equipment_mode[ id ] )
{
menu_additem( menu, "\dВсе гранаты \r* \d[\yHE, FB, SG\d]", "1", 0 );
}
else if ( !get_pcvar_num( p_Equipment ) )
{
menu_additem( menu, "\dВсе гранаты \d[\rdissabled\d]", "1", 0 );
}
if ( !money_mode[ id ] && get_pcvar_num( p_Money ) )
{
menu_additem( menu, "Взять Деньги \d[\y+1250\r$\d]", "2", 0 );
}
else if ( money_mode[ id ] )
{
menu_additem( menu, "\dВзять Деньги \r* \d[\y+1250\r$\d]", "2", 0 );
}
else if ( !get_pcvar_num( p_Money ) )
{
menu_additem( menu, "\dВзять Деньги \d[\rdissabled\d]", "2", 0 );
}
if ( !critical_mode[ id ] && get_pcvar_num( p_Critical ) )
{
menu_additem( menu, "Критический Урон \d[\yШанс крита -\r15%\d]", "3", 0 );
}
else if ( critical_mode[ id ] )
{
menu_additem( menu, "\dКритический Урон \r* \d[\yШанс крита -\r15%\d]", "3", 0 );
}
else if ( !get_pcvar_num( p_Critical ) )
{
menu_additem( menu, "\dКритический Урон \d[\rdissabled\d]", "3", 0 );
}
if ( !soldier_mode[ id ] && get_pcvar_num( p_Soldier ) )
{
menu_additem( menu, "Солдат CSDM \d[\y140\rAP \yи +5HP за фраг\d]", "4", 0 );
}
else if ( soldier_mode[ id ] )
{
menu_additem( menu, "\dСолдат CSDM \r* \d[\y140\rAP \yи +5HP за фраг\d]", "4", 0 );
}
else if ( !get_pcvar_num( p_Soldier ) )
{
menu_additem( menu, "\dСолдат CSDM \d[\rdissabled\d]", "4", 0 );
}
if ( !heavy_mode[ id ] && get_pcvar_num( p_Heavy ) )
{
menu_additem( menu, "Тяжелая броня \d[\y200\rAP \yи иммунитет на \rHead Shot\d]", "5", 0 );
}
else if ( heavy_mode[ id ] )
{
menu_additem( menu, "\dТяжелая броня \r* \d[\y200\rAP \yи иммунитет на \rHead Shot\d]", "5", 0 );
}
else if ( !get_pcvar_num( p_Heavy ) )
{
menu_additem( menu, "\dТяжелая броня \d[\rdissabled\d]", "5", 0 );
}
if ( !medic_mode[ id ] && get_pcvar_num( p_Medic ) )
{
menu_additem( menu, "Восстановления HP \d[\yOnly knife\d]", "6", 0 );
}
else if ( medic_mode[ id ] )
{
menu_additem( menu, "\dВосстановления HP \r* \d[\yOnly knife\d]", "6", 0 );
}
else if ( !get_pcvar_num( p_Medic ) )
{
menu_additem( menu, "\dВосстановления HP \d[\rdissabled\d]", "6", 0 );
}
menu_additem( menu, "\rОтключить все пункты", "7", 0 );
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_setprop( menu, MPROP_NUMBER_COLOR, "\r" );
menu_setprop( menu, MPROP_BACKNAME, "Back" );
menu_setprop( menu, MPROP_NEXTNAME, "Next" );
menu_setprop( menu, MPROP_EXITNAME, "Quit" );
menu_setprop( menu, MPROP_PERPAGE, 7 );
menu_display( id, menu, 0 );
}
}
else if ( get_user_flags( id ) != VIP_ACCESS )
{
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_NO_ACCESS" );
client_cmd( id, "spk silent/vip/noaccess" );
}
return PLUGIN_HANDLED;
}
public menu ( id, menu, item )
{
if ( item == MENU_EXIT )
{
client_cmd( id, "spk silent/vip/menu/button" );
client_cmd( id, "spk silent/vip/menu/close" );
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new data[ 6 ], iName[ 64 ];
new access, callback;
menu_item_getinfo( menu, item, access, data,5, iName, 63, callback );
new key = str_to_num( data );
switch( key )
{
case 1:
{
if ( !equipment_mode[ id ] && get_pcvar_num( p_Equipment ) )
{
equipment_mode[ id ] = 1;
money_mode[ id ] = 0;
critical_mode[ id ] = 0;
soldier_mode[ id ] = 0;
heavy_mode[ id ] = 0;
medic_mode[ id ] = 0;
client_cmd( id, "spk silent/vip/menu/button" );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_EQUIPMENT_FUNCTION" );
}
else if ( equipment_mode[ id ] )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
else if ( !get_pcvar_num( p_Equipment ) )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
}
case 2:
{
if ( !money_mode[ id ] && get_pcvar_num( p_Money ) )
{
equipment_mode[ id ] = 0;
money_mode[ id ] = 1;
critical_mode[ id ] = 0;
soldier_mode[ id ] = 0;
heavy_mode[ id ] = 0;
medic_mode[ id ] = 0;
client_cmd( id, "spk silent/vip/menu/button" );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_MONEY_FUNCTION" );
}
else if ( money_mode[ id ] )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
else if ( !get_pcvar_num( p_Money ) )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
}
case 3:
{
if ( !critical_mode[ id ] && get_pcvar_num( p_Critical ) )
{
equipment_mode[ id ] = 0;
money_mode[ id ] = 0;
critical_mode[ id ] = 1;
soldier_mode[ id ] = 0;
heavy_mode[ id ] = 0;
medic_mode[ id ] = 0;
client_cmd( id, "spk silent/vip/menu/button" );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_CRITICAL_FUNCTION" );
}
else if ( critical_mode[ id ] )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
else if ( !get_pcvar_num( p_Critical ) )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
}
case 4:
{
if ( !soldier_mode[ id ] && get_pcvar_num( p_Soldier ) )
{
equipment_mode[ id ] = 0;
money_mode[ id ] = 0;
critical_mode[ id ] = 0;
soldier_mode[ id ] = 1;
heavy_mode[ id ] = 0;
medic_mode[ id ] = 0;
client_cmd( id, "spk silent/vip/menu/button" );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_SOLDIER_FUNCTION" );
}
else if ( soldier_mode[ id ] )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
else if ( !get_pcvar_num( p_Soldier ) )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
}
case 5:
{
if ( !heavy_mode[ id ] && get_pcvar_num( p_Heavy ) )
{
equipment_mode[ id ] = 0;
money_mode[ id ] = 0;
critical_mode[ id ] = 0;
soldier_mode[ id ] = 0;
heavy_mode[ id ] = 1;
medic_mode[ id ] = 0;
client_cmd( id, "spk silent/vip/menu/button" );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_HEAVY_FUNCTION" );
}
else if ( heavy_mode[ id ] )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
else if ( !get_pcvar_num( p_Heavy ) )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
}
case 6:
{
if ( !medic_mode[ id ] && get_pcvar_num( p_Medic ) )
{
equipment_mode[ id ] = 0;
money_mode[ id ] = 0;
critical_mode[ id ] = 0;
soldier_mode[ id ] = 0;
heavy_mode[ id ] = 0;
medic_mode[ id ] = 1;
client_cmd( id, "spk silent/vip/menu/button" );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_MEDIC_FUNCTION" );
}
else if ( medic_mode[ id ] )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
else if ( !get_pcvar_num( p_Medic ) )
{
client_cmd( id, "spk silent/vip/menu/close" );
}
}
case 7:
{
equipment_mode[ id ] = 0;
money_mode[ id ] = 0;
critical_mode[ id ] = 0;
soldier_mode[ id ] = 0;
heavy_mode[ id ] = 0;
medic_mode[ id ] = 0;
client_cmd( id, "spk silent/vip/menu/button" );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_DISSABLE_FUNCTIONS" );
client_cmd( id, "spk silent/vip/items/dissable" );
}
}
return PLUGIN_HANDLED;
}
public event_NewRound ( id )
{
g_iRoundCount++;
p_Damage = get_pcvar_num( p_Type );
if ( get_pcvar_num( p_Recieved ) )
{
g_showrecieved = true;
}
}
public player_Spawn ( id )
{
if ( get_user_flags( id ) & VIP_ACCESS )
{
if ( get_pcvar_num( p_Enabled ) )
{
if ( is_user_alive( id ) )
{
equipment_active[ id ] = 0;
money_active[ id ] = 0;
critical_active[ id ] = 0;
soldier_active[ id ] = 0;
heavy_active[ id ] = 0;
medic_active[ id ] = 0;
if ( g_iRoundCount == 0 )
{
show_vip_menu( id );
}
if ( equipment_mode[ id ] )
{
equipment_active[ id ] = 1;
equipment( id );
}
if ( money_mode[ id ] )
{
money_active[ id ] = 1;
money( id );
}
if ( critical_mode[ id ] )
{
critical_active[ id ] = 1;
critical( id );
}
if ( soldier_mode[ id ] )
{
soldier_active[ id ] = 1;
soldier( id );
}
if ( heavy_mode[ id ] )
{
heavy_active[ id ] = 1;
heavy( id );
}
if ( medic_mode[ id ] )
{
medic_active[ id ] = 1;
medic( id );
}
if ( p_Defuser && gbBombMap )
{
if ( cs_get_user_team( id ) == CS_TEAM_CT && !cs_get_user_defuse( id ) )
cs_set_user_defuse( id, .defusekit = 1 );
}
}
}
}
}
public equipment ( id )
{
if ( equipment_active[ id ] )
{
cs_set_user_armor( id, 100, CS_ARMOR_VESTHELM );
fm_give_item( id, "weapon_hegrenade" );
fm_give_item( id, "weapon_flashbang" );
fm_give_item( id, "weapon_smokegrenade" );
cs_set_user_bpammo( id, CSW_USP, 100 );
cs_set_user_bpammo( id, CSW_ELITE, 120 );
cs_set_user_bpammo( id, CSW_DEAGLE, 35) ;
cs_set_user_bpammo( id, CSW_GLOCK18, 120) ;
cs_set_user_bpammo( id, CSW_P228, 52 );
cs_set_user_bpammo( id, CSW_FIVESEVEN, 100 );
cs_set_user_bpammo( id, CSW_XM1014, 32 );
cs_set_user_bpammo( id, CSW_M3, 32 );
cs_set_user_bpammo( id, CSW_P90, 100 );
cs_set_user_bpammo( id, CSW_MAC10, 100 );
cs_set_user_bpammo( id, CSW_MP5NAVY, 120 );
cs_set_user_bpammo( id, CSW_TMP, 120 );
cs_set_user_bpammo( id, CSW_UMP45, 100 );
cs_set_user_bpammo( id, CSW_FAMAS, 90 );
cs_set_user_bpammo( id, CSW_GALIL, 90 );
cs_set_user_bpammo( id, CSW_SCOUT, 90 );
cs_set_user_bpammo( id, CSW_AUG, 90 );
cs_set_user_bpammo( id, CSW_M4A1, 90 );
cs_set_user_bpammo( id, CSW_AK47, 90 );
cs_set_user_bpammo( id, CSW_SG552, 90 );
cs_set_user_bpammo( id, CSW_G3SG1, 90 );
cs_set_user_bpammo( id, CSW_SG552, 90 );
cs_set_user_bpammo( id, CSW_AWP, 30 );
cs_set_user_bpammo( id, CSW_M249, 200 );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_EQUIPMENT" );
set_task( 0.1, "shake", id );
}
}
public money ( id )
{
if ( money_active[ id ] )
{
new MaxMoney = 25000;
new BonusMoney = get_pcvar_num( p_MoneyGive );
new TotalMoney = cs_get_user_money( id ) + BonusMoney;
if ( TotalMoney >= MaxMoney )
{
cs_set_user_money( id, MaxMoney );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_MONEY_MAX", get_pcvar_num( p_MoneyGive ) );
client_cmd( id, "spk silent/vip/items/money_max" );
set_task( 0.1, "shake", id );
show_vip_menu( id );
} else {
cs_set_user_money( id, TotalMoney );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_MONEY", get_pcvar_num( p_MoneyGive ) );
set_task( 0.1, "shake", id );
}
}
}
public critical ( id )
{
if ( critical_active[ id ] )
{
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_CRITICAL", get_pcvar_num( p_CriticalChance ) );
set_task( 0.1, "shake", id );
}
}
public soldier ( id )
{
if ( soldier_active[ id ] )
{
cs_set_user_armor( id, get_pcvar_num( p_SoldierArmor ), CS_ARMOR_VESTHELM );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_SOLDIER", get_pcvar_num( p_SoldierArmor ), get_pcvar_num( p_SoldierKillHp ) );
set_task( 0.1, "shake", id );
}
}
public heavy( id )
{
if ( heavy_active[ id ] )
{
cs_set_user_armor( id, get_pcvar_num( p_HeavyArmor ), CS_ARMOR_VESTHELM );
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_HEAVY", get_pcvar_num( p_HeavyArmor ) );
set_task( 0.1, "shake", id );
}
}
public medic ( id )
{
if ( medic_active[ id ] )
{
print_color( id, id, 0, "%L", LANG_SERVER, "VIP_MEDIC", get_pcvar_num( p_MedicHpRegen ), get_pcvar_num( p_MedicHpRegenSpeed ) );
set_task( 0.1, "shake", id );
}
}
public viplist ( id )
{
static sPlayers[ 32 ], iNum, iPlayer;
static sName[ 32 ], sBuffer[ 1024 ];
static iLen;
iLen = formatex( sBuffer, sizeof sBuffer - 1, "<html><head><link rel='stylesheet' type='text/css' href='http://silent.lt/motd/motd.css' media='screen' />" );
iLen += formatex( sBuffer[ iLen ], CharsMax( sBuffer ) - iLen,"<html><head><link rel='stylesheet' type='text/css' href='http://silent.lt/motd/motd.css' media='screen' />" );
get_players( sPlayers, iNum, "ch" );
iLen += formatex( sBuffer[ iLen ], CharsMax( sBuffer ) - iLen, "<center><img src='http://silent.lt/images/vips.png'></img></center><br>" );
for( new x = 0; x < iNum ; x++ )
{
iPlayer = sPlayers[ x ];
if ( get_user_flags( iPlayer ) & VIP_ACCESS )
{
get_user_name( iPlayer, sName, sizeof sName - 1 );
iLen += formatex( sBuffer[ iLen ], CharsMax( sBuffer ) - iLen, "<left>%s</left><br>", sName );
}
}
show_motd( id, sBuffer, "Vip's Online" );
return 0;
}
public shake ( id )
{
client_cmd( id, "spk silent/vip/items/give_item" );
message_begin( MSG_ONE_UNRELIABLE, g_msgFade, .player=id );
{
write_short( 1<<14 );
write_short( 1<<5 );
write_short( FFADE_IN );
write_byte( 34 );
write_byte( 34 );
write_byte( 139 );
write_byte( 75 );
}
message_end( );
message_begin( MSG_ONE_UNRELIABLE, g_msgShake, .player=id );
{
write_short( 255<<15 );
write_short( 50<<8 );
write_short( 255<<15 );
}
message_end( );
}
public print_color ( id, cid, color, const message[ ], any:... )
{
new msg[ 192 ];
vformat( msg, charsmax( msg ), message, 5 );
replace_all( msg, charsmax( msg ), "!g", "^x04" );
replace_all( msg, charsmax( msg ), "!n", "^x01" );
replace_all( msg, charsmax( msg ), "!t", "^x03" );
new param;
if ( !cid )
{
return;
} else {
param = cid;
}
new team[ 32 ];
get_user_team( param, team, 31 );
switch ( color )
{
case 0: msg_teaminfo( param, team );
case 1: msg_teaminfo( param, "TERRORIST" );
case 2: msg_teaminfo( param, "CT" );
case 3: msg_teaminfo( param, "SPECTATOR" );
}
if ( id )
{
msg_saytext( id, param, msg );
} else {
msg_saytext( 0, param, msg );
}
if ( color != 0 )
{
msg_teaminfo( param, team );
}
}
msg_saytext ( id, cid, msg[ ] )
{
message_begin( id?MSG_ONE:MSG_ALL, g_msgSayText, {0,0,0}, id );
write_byte( cid );
write_string( msg );
message_end( );
}
msg_teaminfo ( id, team[ ] )
{
message_begin( MSG_ONE, g_msgTeamInfo, {0,0,0}, id );
write_byte( id );
write_string( team );
message_end( );
}
Вложения
-
27,8 KB Просмотры: 5