Пренаписване на код за bullet damage

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
impossible
Извън линия
Потребител
Потребител
Мнения: 465
Регистриран на: 15 Юни 2019, 12:41
Се отблагодари: 23 пъти
Получена благодарност: 43 пъти

Пренаписване на код за bullet damage

Мнение от impossible » 20 Авг 2019, 14:14

Здравейте ! Ако може да ми пренапишете този код да е с въртящия bullet damage ,а не с обикнновения да дава броножилетка +шлем и каска и за ct да има и deduse kit


това е кода


Код за потвърждение: Избери целия код

#define DAMAGE_RECIEVED
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
new maxplayers
new gmsgSayText
new mpd, mkb, mhb
new g_MsgSync
new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max
new g_awp_active
new g_menu_active
new CurrentRound
new bool:HasC4[33]
#define Keysrod (1<<0)|(1<<1)|(1<<9) // Keys: 1234567890
#if defined DAMAGE_RECIEVED
new g_MsgSync2
#endif

public plugin_init()
{
register_plugin("VIP Eng Version", "3.0", "Dunno")
mpd = register_cvar("money_per_damage","3")
mkb = register_cvar("money_kill_bonus","200")
mhb = register_cvar("money_hs_bonus","500")
health_add = register_cvar("amx_vip_hp", "15")
health_hs_add = register_cvar("amx_vip_hp_hs", "30")
health_max = register_cvar("amx_vip_max_hp", "100")
g_awp_active = register_cvar("awp_active", "1")
g_menu_active = register_cvar("menu_active", "1")
register_event("Damage","Damage","b")
register_event("DeathMsg","death_msg","a")
register_menucmd(register_menuid("rod"), Keysrod, "Pressedrod")
register_clcmd("awp","HandleCmd")
register_clcmd("sg550","HandleCmd")
register_clcmd("g3sg1","HandleCmd")
register_clcmd("say /wantvip","ShowMotd")
maxplayers = get_maxplayers()
gmsgSayText = get_user_msgid("SayText")
register_clcmd("say", "handle_say")
register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
register_logevent("LogEvent_RoundStart", 2, "1=Round_Start" );
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
register_event("DeathMsg", "hook_death", "a", "1>0")
register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0")
g_MsgSync = CreateHudSyncObj()
#if defined DAMAGE_RECIEVED
g_MsgSync2 = CreateHudSyncObj()
#endif	
}

public on_damage(id)
{
new attacker = get_user_attacker(id)

#if defined DAMAGE_RECIEVED
// id should be connected if this message is sent, but lets check anyway
if ( is_user_connected(id) && is_user_connected(attacker) )
if (get_user_flags(attacker) & ADMIN_LEVEL_H)
{
new damage = read_data(2)

set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1)
ShowSyncHudMsg(id, g_MsgSync2, "%i^n", damage)
#else
if ( is_user_connected(attacker) && if (get_user_flags(attacker) & ADMIN_LEVEL_H) )
{
new damage = read_data(2)
#endif
set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1)
ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage)
}
}

public Damage(id)
{
new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
if (get_user_flags(attacker) & ADMIN_LEVEL_H) 
{
new money = read_data(2) * get_pcvar_num(mpd)
if(hitpoint==1) money += get_pcvar_num(mhb)
cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
}
}

public death_msg()
{
if(read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}

public LogEvent_RoundStart()
{
CurrentRound++;
new players[32], player, pnum;
get_players(players, pnum, "a");
for(new i = 0; i < pnum; i++)
{
player = players[i];
if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
{
give_item(player, "weapon_hegrenade")
give_item(player, "weapon_flashbang")
give_item(player, "weapon_flashbang")
give_item(player, "weapon_smokegrenade")
give_item(player, "item_assaultsuit")
give_item(player, "item_thighpack")

if (!get_pcvar_num(g_menu_active))
return PLUGIN_CONTINUE

if(CurrentRound >= 3)
{
Showrod(player);
}
}
}
return PLUGIN_HANDLED
}

public Event_RoundRestart()
{
CurrentRound=0;
}

public hook_death()
{
// Killer id
nKiller = read_data(1)

if ( (read_data(3) == 1) && (read_data(5) == 0) )
{
nHp_add = get_pcvar_num (health_hs_add)
}
else
nHp_add = get_pcvar_num (health_add)
nHp_max = get_pcvar_num (health_max)
// Updating Killer HP
if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
return;

nKiller_hp = get_user_health(nKiller)
nKiller_hp += nHp_add
// Maximum HP check
if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
set_user_health(nKiller, nKiller_hp)
// Hud message "Healed +15/+30 hp"
set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
// Screen fading
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(0)
write_byte(200)
write_byte(75)
message_end()

}

public Showrod(id) {
show_menu(id, Keysrod, "Free VIP Guns^n\w1. Get M4A1+Deagle ^n\w2. Get AK47+Deagle^n0. Exit^n", -1, "rod") // Display menu
}
public Pressedrod(id, key) {
/* Menu:
* VIP Menu
* 1. Get M4A1+Deagle
* 2. Get AK47+Deagle
* 0. Exit
*/
switch (key) {
case 0: { 
if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
HasC4[id] = true;
else
HasC4[id] = false;

strip_user_weapons (id)
give_item(id,"weapon_m4a1")
give_item(id,"ammo_556nato")
give_item(id,"ammo_556nato")
give_item(id,"ammo_556nato")
give_item(id,"weapon_deagle")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"weapon_knife")
give_item(id,"weapon_hegrenade")
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
give_item(id, "item_assaultsuit");
give_item(id, "item_thighpack");
client_print(id, print_center, "You Taked Free M4A1 and Deagle")

if (HasC4[id])
{
give_item(id, "weapon_c4");
cs_set_user_plant( id );
}
}
case 1: { 
if (user_has_weapon(id, CSW_C4) && get_user_team(id) == 1)
HasC4[id] = true;
else
HasC4[id] = false;

strip_user_weapons (id)
give_item(id,"weapon_ak47")
give_item(id,"ammo_762nato")
give_item(id,"ammo_762nato")
give_item(id,"ammo_762nato")
give_item(id,"weapon_deagle")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"ammo_50ae")
give_item(id,"weapon_knife")
give_item(id,"weapon_hegrenade")
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
give_item(id, "item_assaultsuit");
give_item(id, "item_thighpack");
client_print(id, print_center, "You Taked Free AK47 and Deagle")

if (HasC4[id])
{
give_item(id, "weapon_c4");
cs_set_user_plant( id );
}
}
case 9: { 
}
}
return PLUGIN_CONTINUE
}

public HandleCmd(id){
if (!get_pcvar_num(g_awp_active))
return PLUGIN_CONTINUE
if(get_user_flags(id) & ADMIN_LEVEL_H) 
return PLUGIN_CONTINUE
client_print(id, print_center, "Sniper's Only For VIP's")
return PLUGIN_HANDLED
}

public ShowMotd(id)
{
show_motd(id, "vip.txt")
}
public client_authorized(id)
{
set_task(30.0, "PrintText" ,id)
}
public PrintText(id)
{
client_print(id, print_chat, "[VIP] write /wantvip and u will see how get VIP and VIP privilegies.")
}

public handle_say(id) {
new said[192]
read_args(said,192)
if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
set_task(0.1,"print_adminlist",id)
return PLUGIN_CONTINUE
}

public print_adminlist(user) 
{
new adminnames[33][32]
new message[256]
new contactinfo[256], contact[112]
new id, count, x, len

for(id = 1 ; id <= maxplayers ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & ADMIN_LEVEL_H)
get_user_name(id, adminnames[count++], 31)

len = format(message, 255, "%s VIP ONLINE: ",COLOR)
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
print_message(user, message)
len = format(message, 255, "%s ",COLOR)
}
}
print_message(user, message)
}
else {
len += format(message[len], 255-len, "No VIP online.")
print_message(user, message)
}

get_cvar_string("amx_contactinfo", contact, 63)
if(contact[0]) {
format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
print_message(user, contactinfo)
}
}

print_message(id, msg[]) {
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1063\\ f0\\ fs16 \n\\ par }
*/

Добавено преди 7 минути 40 секунди:
за тоя bullet damage става дума.

https://dox.abv.bg/download?id=11813ee60e
Последно промяна от OciXCrom на 20 Авг 2019, 23:04, променено общо 2 пъти.
Причина: Редактирано заглавие!

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7205
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1278 пъти
Обратна връзка:

Пренаписване на код

Мнение от OciXCrom » 20 Авг 2019, 14:25

Няма да пипам този грозен код.

https://forums.alliedmods.net/showthread.php?t=151190

Аватар
impossible
Извън линия
Потребител
Потребител
Мнения: 465
Регистриран на: 15 Юни 2019, 12:41
Се отблагодари: 23 пъти
Получена благодарност: 43 пъти

Пренаписване на код

Мнение от impossible » 20 Авг 2019, 15:16

Пробвах с този не е това което търся аи искам bullet damage да е само за админи и вип затова не съм го направил public

Аватар
hackera457
Извън линия
Модератор
Модератор
Мнения: 768
Регистриран на: 01 Ное 2016, 09:46
Местоположение: София
Се отблагодари: 1 път
Получена благодарност: 122 пъти
Обратна връзка:

Пренаписване на код

Мнение от hackera457 » 20 Авг 2019, 17:36

impossible написа:
20 Авг 2019, 15:16
Пробвах с този не е това което търся аи искам bullet damage да е само за админи и вип затова не съм го направил public
Ето ти плъгина даден от колегата OcixCrom с редакция за ограничаване за играчи с определен флаг. Променяш го от:
const ADMIN_ACCESS = ADMIN_LEVEL_H

Код за потвърждение: Избери целия код

#include < amxmodx >
#include < engine >

#define VERSION "2.0"

#define DIRECTOR_HUD_MESSAGE	0
#define NORMAL_HUD_MESSAGE	1

//Begin hackera457 Stuff
const ADMIN_ACCESS = ADMIN_LEVEL_H
////////////////////////////////



new pCvar_VictimC, pCvar_OurselfC, pCvar_AttackerC, pCvar_BulletMode, pCvar_Bullet_Distance, pCvar_Bullet_Walls, 
pCvar_Bullet_ShowSpec, pCvar_Bullet_Hs_Mode, pCvar_Bullet_Text_Mode, pCvar_Bullet_Show_Mode, pCvar_Accumulated_Damage

new dhud_color, dhud_x, dhud_y, dhud_effect, dhud_fxtime, dhud_holdtime, dhud_fadeintime, dhud_fadeouttime, dhud_reliable

new Float: Yv[ 33 ], Float: Xv[ 33 ] /* Victim*/, Float: Ya[ 33 ], Float: Xa[ 33 ] // Attacker

new bool: ShowMeThisHud[ 33 ], MyCurrentDamages[ 33 ], iSyncObj

public plugin_init( ) 
{
	register_plugin( "Bullet Damage", VERSION, "Bboy Grun" )
	
	register_cvar( "Director_bullet_dmg", VERSION, FCVAR_SERVER | FCVAR_SPONLY )
	set_cvar_string( "Director_bullet_dmg", VERSION )
	
	register_event( "Damage", "Event_Damage", "b", "2!0", "3=0", "4!0" ) 
	
	register_clcmd( "say /showbd", "Say_showbd" )
	register_clcmd( "say showbd", "Say_showbd" )
	
	iSyncObj = CreateHudSyncObj( )
	
	pCvar_BulletMode =     		register_cvar( "Bullet_Damage_Mode", "0" ) 
	pCvar_Bullet_Distance =    	register_cvar( "Bullet_Damage_Distance", "600" ) 
	pCvar_Bullet_Walls = 		register_cvar( "Bullet_Damage_NoShowWalls", "0" )
	pCvar_Bullet_ShowSpec =		register_cvar( "Bullet_Show_Spec", "1" )
	pCvar_Bullet_Hs_Mode  = 		register_cvar( "Bullet_Hs_Mode", "2" )
	pCvar_Bullet_Text_Mode =	register_cvar( "Bullet_Text_Mode", "0" )
	pCvar_Bullet_Show_Mode = 	register_cvar( "Bullet_Show_Mode", "3" )
	pCvar_Accumulated_Damage = 	register_cvar( "Show_Accumulated_Damage", "1" )
	
	pCvar_VictimC = 		register_cvar( "Color_RGB_Victim", "255000000" )
	pCvar_AttackerC = 		register_cvar( "Color_RGB_Attacker", "000255000" )
	pCvar_OurselfC =		register_cvar( "Color_RGB_Ourself_Teammate", "255102021" )
}

public plugin_natives( )
{
	register_native( "bd_show_damage", "native_bd_show_damage", 0 )
	register_native( "bd_show_text", "native_bd_show_text", 0 )
}

// HELP : http://forums.alliedmods.net/showthread.php?p=1436434#post1436434 Thanks to schmurgel1983
public native_bd_show_text( iPlugin, iParams )
{
	new id = get_param( 1 )
	
	if( !is_user_connected( id ) ) // user disconnected .. return 0
	{
		return 0
	}
	
	new Text[ 128 ], Attacker, Size
	
	Attacker = get_param( 2 )
	Size = get_param( 3 )
	
	get_string( 3, Text, charsmax( Text ) )
	show_client_text( id, Text, Attacker, Size )
	
	if( Attacker ) // Is the player attacker ? Yes = 1 -- No = 0
	{
		CheckPosition( id, Attacker )
		return 1
	}
	
	CheckPosition( id, 0 )
	return 1
}

public native_bd_show_damage( iPlugin, iParams )
{
	new id = get_param( 1 )
	
	if( !is_user_connected( id ) )
	{
		return 0
	}
	
	new damage, style, Attacker
	damage = get_param( 2 ); style = get_param( 3 ); Attacker = get_param( 4 )
	
	show_client_value( id, damage, Attacker, style )
	
	if( Attacker ) // Is the player attacker ? Yes = 1 -- No = 0
	{
		CheckPosition( id, Attacker )
		return 1
	}
	
	CheckPosition( id, 0 )
	return 1
}

// Director Hud Message, go to : http://forums.alliedmods.net/showthread.php?t=149210 by : ARKSHINE
public Event_Damage( Victim )
{    
	static Attacker, AttackerWpn, VictimBodyPart
	Attacker = get_user_attacker( Victim, AttackerWpn, VictimBodyPart )
	
	if( !is_user_alive( Attacker ) || ( get_pcvar_num( pCvar_Bullet_Walls ) && !is_visible( Attacker, Victim ) ) || !(get_user_flags(Attacker) & ADMIN_ACCESS) )
	{
		return;
	}
		
	static damage, R, G, B, pCvar_H, pCvar_TMODE 
	damage = read_data( 2 )
	
	pCvar_H = get_pcvar_num( pCvar_Bullet_Hs_Mode )
	pCvar_TMODE = get_pcvar_num( pCvar_Bullet_Text_Mode )
	
	static AttackerOrigin[ 3 ], VictimOrigin[ 3 ]
	
	if( Attacker != Victim && get_user_team( Attacker ) != get_user_team( Victim ) )
	{
		if( pCvar_H > 0 && VictimBodyPart == HIT_HEAD )
		{
			if( pCvar_H == 1 )
			{
				show_client_value( Victim, damage, 0, DIRECTOR_HUD_MESSAGE )
				show_client_value( Attacker, damage, 1, DIRECTOR_HUD_MESSAGE )
			}
			else
			{
				show_client_text( Victim, "HEADSHOT", 0, pCvar_TMODE )
				show_client_text( Attacker, "HEADSHOT", 1, pCvar_TMODE )
			}
		}
		else
		{
			if( !get_pcvar_num( pCvar_BulletMode ) )
			{
				show_client_value( Victim, damage, 0, DIRECTOR_HUD_MESSAGE )
				show_client_value( Attacker, damage, 1, DIRECTOR_HUD_MESSAGE )
			}
		
			else
			{
				get_user_origin( Attacker, AttackerOrigin )
				get_user_origin( Victim, VictimOrigin )
				
				if( get_distance( AttackerOrigin, VictimOrigin ) >  get_pcvar_num( pCvar_Bullet_Distance ) )
				{
					show_client_value( Victim, damage, 0, NORMAL_HUD_MESSAGE )
					show_client_value( Attacker, damage, 1, NORMAL_HUD_MESSAGE )
				}
				else
				{
					show_client_value( Victim, damage, 0, DIRECTOR_HUD_MESSAGE )
					show_client_value( Attacker, damage, 1, DIRECTOR_HUD_MESSAGE )
				}
			}
		}
        
		CheckPosition( Victim, 0 )
		CheckPosition( Attacker, 1 )
		
		if( MyCurrentDamages[ Attacker ] == -1 || !get_pcvar_num( pCvar_Accumulated_Damage ) )
		{
			 // MyCurrentDamages[ Attacker ] == -1 : The player is a BOT
			return;
		}
		
		MyCurrentDamages[ Attacker ] += damage
		UpdateDamages( Attacker )
	}
	else
	{
		// http://forums.alliedmods.net/showthread.php?t=62224
		static iColor; iColor = get_pcvar_num( pCvar_OurselfC )
		R = iColor / 1000000
		iColor %= 1000000
		G = iColor / 1000
		B = iColor % 1000
		
		set_dhudmessage( R, G, B, -1.0, -1.0, 2, 0.0, 2.0, 0.1, 0.1 )
		show_dhudmessage( Victim, "%i", damage )    // Show the damages to the player
	}
}

public Say_showbd( id ) 
{
	if( ShowMeThisHud[ id ] )
	{
		ShowMeThisHud[ id ] = false
		client_print( id, print_chat, "[ BULLET DAMAGE %s ] STATUS : OFF", VERSION )
		return;
	}
	
	client_print( id, print_chat, "[ BULLET DAMAGE %s ] STATUS : ON", VERSION )
	ShowMeThisHud[ id ] = true
}

public client_putinserver( id )
{
	iRefreshHudPosition( id )
	
	ShowMeThisHud[ id ] = true
	MyCurrentDamages[ id ] = is_user_bot( id ) ? -1 : 0
	
	// Don't show Current Accumulated Damages to bots
}

// Director Hud Message, go to : http://forums.alliedmods.net/showthread.php?t=149210 by : ARKSHINE

stock set_dhudmessage( red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 6.0, Float:holdtime = 3.0, Float:fadeintime = 0.1, Float:fadeouttime = 1.5, bool:reliable = false )
{
	#define clamp_byte(%1)       		( clamp( %1, 0, 255 ) )
	#define pack_color(%1,%2,%3)	( %3 + ( %2 << 8 ) + ( %1 << 16 ) )

	dhud_color		= 		pack_color( clamp_byte( red ), clamp_byte( green ), clamp_byte( blue ) )
	dhud_x 			=	_:	x
	dhud_y 			= 	_: 	y
	dhud_effect 		= 		effects
	dhud_fxtime 		= 	_: 	fxtime
	dhud_holdtime 		=	_: 	holdtime
	dhud_fadeintime 	=	_: 	fadeintime
	dhud_fadeouttime 	=	_: 	fadeouttime
	dhud_reliable 		= 	_: 	reliable

	return 1;
}

stock show_dhudmessage( index, const message[ ], any:... )
{
	new buffer[ 128 ]
	new numArguments = numargs( )

	if( numArguments == 2 )
	{
		send_dhudMessage( index, message )
	}
	else if( index || numArguments == 3 )
	{
		vformat( buffer, charsmax( buffer ), message, 3 )
		send_dhudMessage( index, buffer )
	}
	else
	{
		new playersList[ 32 ], numPlayers;
		get_players( playersList, numPlayers, "ch" )

		if( !numPlayers )
		{
			return 0;
		}

		new Array:handleArrayML = ArrayCreate()

		for( new i = 2, j; i < numArguments; i++ )
		{
			if( getarg( i ) == LANG_PLAYER )
			{
				while( ( buffer[ j ] = getarg( i + 1, j++ ) ) ) {}
				j = 0

				if( GetLangTransKey( buffer ) != TransKey_Bad )
				{
					ArrayPushCell( handleArrayML, i++ )
				}
			}
		}

		new size = ArraySize( handleArrayML )

		if( !size )
		{
			vformat( buffer, charsmax( buffer ), message, 3 )
			send_dhudMessage( index, buffer )
		}
		else
		{
			for( new i = 0, j; i < numPlayers; i++ )
			{
				index = playersList[ i ]

				for( j = 0; j < size; j++ )
				{
					setarg( ArrayGetCell( handleArrayML, j ), 0, index )
				}
				
				vformat( buffer, charsmax( buffer ), message, 3 )
				send_dhudMessage( index, buffer )
			}
		}

		ArrayDestroy( handleArrayML )
	}
	return 1;
}

stock send_dhudMessage( const index, const message[ ] )
{
	message_begin( dhud_reliable ? ( index ? MSG_ONE : MSG_ALL ) : ( index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST ), SVC_DIRECTOR, _, index )
	{
		write_byte( strlen( message ) + 31 )
		write_byte( DRC_CMD_MESSAGE )
		write_byte( dhud_effect )
		write_long( dhud_color )
		write_long( dhud_x )
		write_long( dhud_y )
		write_long( dhud_fadeintime )
		write_long( dhud_fadeouttime )
		write_long( dhud_holdtime )
		write_long( dhud_fxtime )
		write_string( message )
	}
	message_end()
} 

UpdateDamages( id )
{
	if( !ShowMeThisHud[ id ] )
	{
		return;
	}
	
	set_hudmessage( 0, 255, 0, -1.0, -0.50, 0, 0.0, 4.0, 0.0, 1.0, -1 )
	ShowSyncHudMsg( id, iSyncObj, "%d", MyCurrentDamages[ id ] )
	
	if( task_exists( 999_666_999 + id ) )
	{
		remove_task( 999_666_999 + id ) 
	}
	
	set_task( 5.0, "ResetCurrentDamages", 999_666_999 + id )
}

public ResetCurrentDamages( TaskID )
{
	MyCurrentDamages[ TaskID - 999_666_999 ] = 0
}

show_client_value( id, damage, Attacker, iSize )
{
	if( !ShowMeThisHud[ id ] )
	{
		return;
	}
	
	static iColor, R, G, B, Float: Y_Pos, Float: X_Pos
	
	if( Attacker ) // The user is the Attacker ( Attacker value = 1 )
	{
		// Attacker
		iColor = get_pcvar_num( pCvar_AttackerC )
		Y_Pos = Ya[ id ]
		X_Pos = Xa[ id ]
	}
	else
	{
		// Victim
		iColor = get_pcvar_num( pCvar_VictimC )
		Y_Pos = Yv[ id ]
		X_Pos = Xv[ id ]
	}
	
	R = iColor / 1000000
	iColor %= 1000000
	G = iColor / 1000
	B = iColor % 1000
	
	if( iSize )
	{
		set_hudmessage( R, G, B, X_Pos, Y_Pos, 2, 0.0, 1.0, 0.02, 0.02 )
		show_hudmessage( id, "%i", damage )
	}
	else
	{
		set_dhudmessage( R, G, B, X_Pos, Y_Pos, 2, 0.0, 1.0, 0.02, 0.02 )
		show_dhudmessage( id, "%i", damage )
	}
	
	if( !get_pcvar_num( pCvar_Bullet_ShowSpec ) )
	{
		return;
	}
	
	SpectatorHud( id, damage, _, 0, iSize, Float: X_Pos, Float: Y_Pos, R, G, B )
}

show_client_text( id, iText[ ], Attacker, iSize )
{
	if( !ShowMeThisHud[ id ] )
	{
		return;
	}
	
	static iColor, R, G, B, Float: Y_Pos, Float: X_Pos
	
	if( Attacker ) // The user is the Attacker ( Attacker value = 1 )
	{
		// Attacker
		iColor = get_pcvar_num( pCvar_AttackerC )
		Y_Pos = Ya[ id ]
		X_Pos = Xa[ id ]
	}
	else
	{
		// Victim
		iColor = get_pcvar_num( pCvar_VictimC )
		Y_Pos = Yv[ id ]
		X_Pos = Xv[ id ]
	}
	
	R = iColor / 1000000
	iColor %= 1000000
	G = iColor / 1000
	B = iColor % 1000
	
	if( !iSize )
	{
		set_dhudmessage( R, G, B, X_Pos, Y_Pos, 2, 0.0, 1.0, 0.02, 0.02 )
		show_dhudmessage( id, "%s", iText )
	}
	else
	{
		set_hudmessage( R, G, B, X_Pos, Y_Pos, 2, 0.0, 1.0, 0.02, 0.02, -1 )
		show_hudmessage( id, "%s", iText )
	}
	
	if( !get_pcvar_num( pCvar_Bullet_ShowSpec ) )
	{
		return;
	}
	
	SpectatorHud( id, _, iText, 1, iSize, Float: X_Pos, Float: Y_Pos, R, G, B )
}

SpectatorHud( id, iDamage = 0, iText[ ] = "", TextMode, Size, Float: X_Pos, Float: Y_Pos, R, G, B )
{
	static iPlayers[ 32 ], iNum
	get_players( iPlayers, iNum, "bch" )
	
	for( new i = 0, Spectator = iPlayers[ 0 ]; i < iNum; Spectator = iPlayers[ i++ ] )
	{		
		if( ShowMeThisHud[ Spectator ] && entity_get_int( Spectator, EV_INT_iuser2 ) == id )
		{
			if( !Size )
			{
				set_dhudmessage( R, G, B, X_Pos, Y_Pos, 2, 0.0, 1.0, 0.02, 0.02 )
				TextMode ? show_dhudmessage( Spectator, "%s", iText ) : show_dhudmessage( Spectator, "%d", iDamage )
			}
			else
			{
				set_hudmessage( R, G, B, X_Pos, Y_Pos, 2, 0.0, 1.0, 0.02, 0.02, -1 )
				TextMode ? show_hudmessage( Spectator, "%s", iText ) : show_hudmessage( Spectator, "%d", iDamage )
			}
		}
	}
}

iRefreshHudPosition( id )
{
	switch( get_pcvar_num( pCvar_Bullet_Show_Mode ) )
	{
		case 0:
		{
			Ya[ id ] = -0.50
			Xa[ id ] = -0.70
			
			Yv[ id ] = -0.45
			Xv[ id ] = -0.30
			
		}
		case 1:
		{
			Ya[ id ] = 0.55
			Xa[ id ] = 0.53
			
			Xv[ id ] = 0.45
			Yv[ id ] = 0.50
		}
		case 2:
		{
			Ya[ id ] = -0.35
			Xa[ id ] = -0.70
			
			Yv[ id ] = -0.20
			Xv[ id ] = -0.70
		}
		case 3:
		{
			Xv[ id ] = -0.80
			Yv[ id ] = -0.90
			
			Xa[ id ] = -0.20
			Ya[ id ] = -0.90
		}
	}
}

CheckPosition( id, Attacker )
{
	switch( get_pcvar_num( pCvar_Bullet_Show_Mode ) ) 
	// [ 0 = CIRCLE ] [ 1 = VERTICAL ] [ 2 = HORIZONTAL ] [ 3 = ARCH OF CIRCLE  ]
	{
		case 0:
		{
			if( Attacker )
			{
				switch( Xa[ id ] )
				{
					case -0.70: // First attack
					{
						Xa[ id ] = -0.575
						Ya[ id ] = -0.60
					}
					case -0.575: // Second
					{
						Xa[ id ] = -0.50
						Ya[ id ] = -0.625
					}
					case -0.50: // Third
					{
						Xa[ id ] = -0.425
						Ya[ id ] = -0.60
					}
					case -0.425: // Fourth
					{		
						Xa[ id ] = -0.30
						Ya[ id ] = -0.50
					}
					case -0.30: // Last
					{
						Xa[ id ] = -0.70
					}
					default: iRefreshHudPosition( id )
				}
			}
			else
			{
				switch( Xv[ id ] )
				{
					case -0.30: // First attack
					{
						Xv[ id ] = -0.425
						Yv[ id ] = -0.35
					}
					case -0.425: // Second
					{		
						Xv[ id ] = -0.50
						Yv[ id ] = -0.30
					}
					case -0.50: // Third
					{
						Xv[ id ] = -0.575
						Yv[ id ] = -0.35
					}
					case -0.575: // fourth
					{
						Xv[ id ] = -0.70
						Yv[ id ] = -0.45
					}
					case -0.70: // Last
					{
						Xv[ id ] = -0.30
					}
					default: iRefreshHudPosition( id )
				}
			}
		}
		case 1:
		{
			if( Attacker ) 
			{
				Ya[ id ] += 0.05
				if( Ya[ id ] >= 0.90 )
				{
					Ya[ id ] = 0.55
				}
			}
			else
			{
				Yv[ id ] += 0.05
				if( Yv[ id ] >= 0.85 )
				{
					Yv[ id ] = 0.50
				}
			}
		}
		case 2:
		{
			if( Attacker )
			{
				Xa[ id ] += 0.05
				if( Xa[ id ] >= -0.35 )
				{
					Xa[ id ] = -0.70
				}
			}
			else
			{
				Xa[ id ] += 0.05
				if( Xv[ id ] >= -0.35 )
				{
					Xv[ id ] = -0.70
				}
			}
		}
		case 3:
		{
			if( Attacker )
			{
				switch( Xa[ id ] )
				{
					case -0.20: // First attack
					{
						
						if( Ya[ id ] == -0.20 )
						{
							Xa[ id ] = -0.20
							Ya[ id ] = -0.90
						}
						else
						{
							Xa[ id ] = -0.15
							Ya[ id ] = -0.80
						}
					}
					case -0.15:
					{
						switch( Ya[ id ] )
						{
							case -0.80: Ya[ id ] = -0.70
							case -0.70: Ya[ id ] = -0.60
							case -0.60: Ya[ id ] = -0.50
							case -0.50: Ya[ id ] = -0.40
							case -0.40: Ya[ id ] = -0.30
							case -0.30:
							{
								Xa[ id ] = -0.20
								Ya[ id ] = -0.20
							}
						}
					}
					default: iRefreshHudPosition( id )
				}
			}
			else
			{
				switch( Xv[ id ] )
				{
					case -0.80: // First attack
					{
						
						if( Yv[ id ] == -0.20 )
						{
							Xv[ id ] = -0.80
							Yv[ id ] = -0.90
						}
						else
						{
							Xv[ id ] = -0.85
							Yv[ id ] = -0.80
						}
					}
					case -0.85:
					{
						switch( Yv[ id ] )
						{
							case -0.80: Yv[ id ] = -0.70
							case -0.70: Yv[ id ] = -0.60
							case -0.60: Yv[ id ] = -0.50
							case -0.50: Yv[ id ] = -0.40
							case -0.40: Yv[ id ] = -0.30
							case -0.30:
							{
								Xv[ id ] = -0.80
								Yv[ id ] = -0.20
							}
						}
					}
					default: iRefreshHudPosition( id )
				}
			}
		}
		default: iRefreshHudPosition( id )
	}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
Моите плъгини

Код за потвърждение: Избери целия код

#include <hambeer>

RegisterHamBeer(HamBeer_Spawn, "player", "GivePlayerBeer", 1);

public GivePlayerBeer(Pl){
    if(!is_user_alive(Pl)){
        ham_give_beer(Pl, 5)
        client_print(Pl, print_chat, "Go Go Go"){
}  


Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Google [Bot] и 17 госта