#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <fakemeta>
#pragma tabsize 0
#define VIP_FLAG ADMIN_LEVEL_H
//sus pui flagu de la vip in loc de ADMIN_LEVEL_H pui ce vrei tu.
new kill_vip,kill_vip_hs
public plugin_init()
{
register_plugin("Vip", "1.0", "D3luxe")
RegisterHam(Ham_Killed, "player", "killed")
//cvaruri
kill_vip = register_cvar("vip_kill", "15");
kill_vip_hs = register_cvar("vip_kill_hs", "25")
}
public killed(victim, attacker, shouldgib)
{
if(is_user_alive(attacker) && (get_user_health(attacker) < 250) && get_user_flags(attacker) & VIP_FLAG )
{
if(get_pdata_int(victim, 75) == HIT_HEAD)
{
set_user_health(attacker,get_user_health(attacker) +get_pcvar_num(kill_vip_hs) )
ColorChat(attacker,"^x04[VIP]^x01 Ai primit ^x03%d ^x01HP pentru acest ^x03HeadShoot !",get_pcvar_num(kill_vip_hs) );
}else
{
set_user_health(attacker,get_user_health(attacker) +get_pcvar_num(kill_vip) )
ColorChat(attacker,"^x04[VIP]^x01 Ai primit ^x03%d ^x01HP pentru acest ^x03 Frag !",get_pcvar_num(kill_vip) );
}
}
return PLUGIN_CONTINUE;
}
public client_putinserver(id) {
if(get_user_flags(id) & VIP_FLAG)
{
static name[32]
get_user_name(id,name,charsmax(name))
color(0,"!gVIP %s connected",name)
}
}
stock ColorChat(const id, const input[], any:...) {
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!v", "^4");
replace_all(msg, 190, "!c", "^1");
replace_all(msg, 190, "!e", "^3");
if(id) players[0] = id;
else get_players(players, count, "ch"); {
for(new i = 0; i < count; i++) {
if(is_user_connected(players[i])) {
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
stock color( const id, const input[ ], any:... )
{
new count = 1, players[ 32 ]
static msg[ 191 ]
vformat( msg, 190, input, 3 )
replace_all( msg, 190, "!g", "^4" ) //- verde
replace_all( msg, 190, "!y", "^1" ) //- galben
replace_all( msg, 190, "!team", "^3" ) //- echipa
replace_all( msg, 190, "!n", "^0" ) //- normal
if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
{
for( new i = 0; i < count; i++ )
{
if( is_user_connected( players[ i ] ) )
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
write_byte( players[ i ] );
write_string( msg );
message_end( );
}
}
}
}