New HUD System( Show AP / HP )

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 425
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

20 Jan 2017, 21:59

Zp.bodo wrote:Nu ai putea modifica pluginul sa scoata armura si viata? Fara sa mai pui alt hud.
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
	register_plugin("Remove HP & AP (HUD)", "1.0", "YONTU");
	register_event("ResetHUD", "event_ResetHud", "be");
}

public client_putinserver(id) set_task(1.0, "ShowHud", id + 12791, _, _, "b");

public event_ResetHud(id) ShowHud(id);

public ShowHud(tid)
{
	new id = tid - 12791;

	if(is_user_alive(id))
		set_pdata_int(id, 361, get_pdata_int(id, 361) | (1<<3));
}
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
RoyalServer 2
User avatar
ALEXVL
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 22 Jul 2015, 00:01
Detinator Steam: Da
CS Status: Online
Detinator server CS: ZMX.LSEPLAY.COM
SteamID: Da
Fond eXtream: 0
Contact:

05 Jun 2017, 03:04

Salut stiu ca postul e vechi dar ca sa nu mai fac alt topic

Puteti face sa apara si ce level ai la cel postat de ulqiuara dupa

Ulquiorra wrote:
| Afiseaza codul
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >



/*
 * Returns a players credits
 * 
 * @param		client - The player index to get points of
 * 
 * @return		The credits client
 * 
 */

native fcs_get_user_credits(client);

/*
 * Sets <credits> to client
 * 
 * @param		client - The player index to set points to
 * @param		credits - The amount of credits to set to client
 * 
 * @return		The credits of client
 * 
 */

native fcs_set_user_credits(client, credits);

/*
 * Adds <credits> points to client
 * 
 * @param		client - The player index to add points to
 * @param		credits - The amount of credits to add to client
 * 
 * @return		The credits of client
 * 
 */

stock fcs_add_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
}

/*
 * Subtracts <credits>  from client
 * 
 * @param		client - The player index to subtract points from
 * @param		credits - The amount of credits to substract from client
 * 
 * @return		The credits of client
 * 
 */

stock fcs_sub_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
}


new const PLUGIN_NAME[  ] = "New HUD System( Show AP / HP )";
new const PLUGIN_VERSION[  ] = "1.0";
new const PLUGIN_AUTHOR[  ] = "YONTU";

#define ColorRed		0
#define ColorGreen	255
#define ColorBlue		0

#define SpecColorRed	0
#define SpecColorGreen	200
#define SpecColorBlue	200

// Thanks Aragon for this codes( director HUD )
#define clamp_byte(%1)		( clamp( %1, 0, 255 ) )
#define pack_color(%1,%2,%3)	( %3 + ( %2 << 8 ) + ( %1 << 16 ) )

const PEV_SPEC_TARGET = pev_iuser2;

new SyncHudMessage;

new g_cvar_show_type;

public plugin_init(  ) {

	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_event( "ResetHUD", "event_ResetHud", "be" );

	RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawnedPost", 1 );

	g_cvar_show_type = register_cvar( "nhs_show", "1" );

	SyncHudMessage = CreateHudSyncObj(  );
}

public Ham_PlayerSpawnedPost( id )
	if( is_user_connected( id ) )
		set_task( 1.0, "ShowHud", id, _, _, "b" );

public event_ResetHud( id )
	ShowHud( id );

public ShowHud( id ) {

	switch( get_pcvar_num( g_cvar_show_type ) ) {

		case 0: {

			if( is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

				new szMessage[ 256 ];
				formatex( szMessage, sizeof( szMessage ) - 1,"Health: %d   Armor: %d   Credits: %i", get_user_health( id ), get_user_armor( id ), fcs_get_user_credits( id ) );

				set_hudmessage( ColorRed, ColorGreen, ColorBlue, 0.02, 0.94, 0, 0.5, 15.0, 2.0, 2.0, -1 );
				ShowSyncHudMsg( id, SyncHudMessage, szMessage );

				set_pdata_int( id, 361, get_pdata_int( id, 361 ) | ( 1<<3 ) );
			}

			else {

				new idSpec;
				new szPlayerName[ 32 ];

				idSpec = pev( id, PEV_SPEC_TARGET );
				get_user_name( idSpec, szPlayerName, 31 );

				set_hudmessage( SpecColorRed, SpecColorGreen, SpecColorBlue, -1.0, 0.7, 0, 0.5, 15.0, 2.0, 2.0, -1 );
				ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nArmor: %d^nCredits: %i", szPlayerName, get_user_health( idSpec ), get_user_armor( idSpec ), fcs_get_user_credits( idSpec ) );
			}
		}

		case 1: {
	
			if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

				new szMessage[ 256 ];
				formatex( szMessage, sizeof( szMessage ) - 1,"Health: %d   Armor: %d   Credits: %i", get_user_health( id ), get_user_armor( id ), fcs_get_user_credits( id ) );

				ShowHudMessage( id, szMessage, ColorRed, ColorGreen, ColorBlue, 0.02, 0.94, 0, _, 1.0 );

				set_pdata_int( id, 361, get_pdata_int( id, 361 ) | ( 1<<3 ) );
			}

			else {

				new idSpec;
				new szPlayerName[ 32 ];

				idSpec = pev( id, PEV_SPEC_TARGET );
				get_user_name( idSpec, szPlayerName, 31 );

				new szMessage[ 256 ];
				formatex( szMessage, sizeof( szMessage ) - 1,"Spectating: %s^nHealth: %d^nArmor: %d^nCredits: %i", szPlayerName, get_user_health( idSpec ), get_user_armor( idSpec ), fcs_get_user_credits( idSpec ) );

				ShowHudMessage( id, szMessage, SpecColorRed, SpecColorGreen, SpecColorBlue, -1.0, 0.7, 0, _, 1.0 );
			}
		}
	}
}

stock ShowHudMessage( const id, const szMessage[  ], red = 0, green = 160, blue = 0, Float:x = -1.0, Float:y = 0.65, effects = 2, Float:fxtime = 0.01, Float:holdtime = 3.0, Float:fadeintime = 0.01, Float:fadeouttime = 0.01 ) {

	new iCount = 1, szPlayers[ 32 ];
	
	if( id )
		szPlayers[ 0 ] = id;

	else
	get_players( szPlayers, iCount, "ch"); {

		for( new i = 0; i < iCount; i++ ) {

			if( is_user_connected( szPlayers[ i ] ) ) {

				new iColor = pack_color( clamp_byte( red ), clamp_byte( green ), clamp_byte( blue ) )
				
				message_begin( MSG_ONE_UNRELIABLE, SVC_DIRECTOR, _, szPlayers[ i ] );
				write_byte( strlen( szMessage ) + 31 );
				write_byte( DRC_CMD_MESSAGE );
				write_byte( effects );
				write_long( iColor );
				write_long( _:x );
				write_long( _:y );
				write_long( _:fadeintime );
				write_long( _:fadeouttime );
				write_long( _:holdtime );
				write_long( _:fxtime );
				write_string( szMessage );
				message_end(  );
			}
		}
	}
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }
*/
vezi sa fie sub cel de credite.
ZOMBIE CROWN ROMANIA.
The NeW Wolrd Zombie
view server | Afiseaza codul
[ Mod:[/size] Image] [Statistici:[/size] Image ][IP:[/size] Image ]
Post Reply

Return to “Pluginuri eXtream”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests