Colorare plugins Call Medic

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
MarioDaniel
Membru, skill 0
Membru, skill 0
Posts: 88
Joined: 18 Jun 2014, 16:43
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: hnsip.zapto.org
Fond eXtream: 0
Has thanked: 22 times
Contact:

18 Jun 2014, 17:16

Vreau si eu sa imi colorati acest plugins care cheama medicu pentru hns.
Vreau sa fie colorat si tradus in limba romana.
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Call Medic"
#define VERSION "0.7"
#define AUTHOR "Grinf4ce"
#define TAG "[Medic]"

#if cellbits == 32
   #define OFFSET_CSMONEY  115
#else
   #define OFFSET_CSMONEY  140
#endif
#define OFFSET_LINUX      5

new MODE,REG_HEALTH, MAXHEALTH, COSTS,SHOUT, MESSAGE, COOLDOWN
new PlayerReload[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_cvar("medic_version",VERSION,FCVAR_SERVER);
	set_cvar_string("medic_version",VERSION);
	
	/* Register CVARs */
	MODE = register_cvar("medic_enabled","1")				/* Mode 1: On ;; Mode 0: Off */	
	REG_HEALTH = register_cvar("medic_health","20")				// How many Health you get instantly?
	
	MAXHEALTH = register_cvar("medic_maxhp","100")				// Maximal HP for everyone	
	COSTS = register_cvar("medic_costs","2000")				// How many costs medic?
	SHOUT = register_cvar("medic_shout","1")				// Shout Medic if you buy medic?
	MESSAGE = register_cvar("medic_message","1")				// Write a Message if you buy medic?
	COOLDOWN = register_cvar("medic_cooldown","10")				// Cooldown-Time in Seconds
	
	/* Register Commands */
	register_clcmd("/medic","call_medic",ADMIN_ALL)
	register_clcmd("medic","call_medic",ADMIN_ALL)
	register_clcmd("say /medic","call_medic",ADMIN_ALL)
	register_clcmd("say medic","call_medic",ADMIN_ALL)
	register_clcmd("say_team /medic","call_medic",ADMIN_ALL)
	register_clcmd("say_team medic","call_medic",ADMIN_ALL)
}

public plugin_precache() {
	precache_sound("medic.wav")
}

public client_connect(id) {
	PlayerReload[id] = 0
}

public client_disconnect(id) {
	PlayerReload[id] = 0
}

public call_medic(id) {
	/* Mods and Stuff */
	if(get_pcvar_num(MODE) == 1 && PlayerReload[id] < time())
	{
		new ActuellHP = get_user_health(id);
		new ActuellMoney = fm_cs_get_user_money(id);
		
		if(ActuellMoney < get_pcvar_num(COSTS))
		{
			client_print(id,print_chat,"%s You haven't enought money to call medic!",TAG)
		}
		else
		{
			if(ActuellHP < get_pcvar_num(MAXHEALTH))
			{
				/* Shout if activated */
				/* Write message if activated */
				new playerCount, i, players[32], name[33];
				get_players(players, playerCount, "ach");
				get_user_name(id,name,32)
					
				for(i=1; i<=playerCount; i++)
				{
					if(get_user_team(id) == get_user_team(i))
					{
						if(get_pcvar_num(MESSAGE) == 1)
						{
							client_print(i,print_chat,"%s (RADIO): Medic!",name)
							
							if(get_pcvar_num(SHOUT) == 1)
							{
								engfunc(EngFunc_EmitSound, i, CHAN_ITEM, "medic.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
							}
						}						
					}

				}

				new Float:Lebenplus = get_pcvar_float(REG_HEALTH);
				
				if(ActuellHP + Lebenplus > get_pcvar_num(MAXHEALTH))
				{
					set_pev(id,pev_health,get_pcvar_float(MAXHEALTH))
				}
				else
				{
					set_pev(id,pev_health,ActuellHP + Lebenplus);
				}

				PlayerReload[id] = time() + get_pcvar_num(COOLDOWN)		/* Activate Reload */
				fm_cs_set_user_money(id,ActuellMoney-get_pcvar_num(COSTS),1)	/* Pay.. */

			}
			else
			{
				client_print(id,print_chat,"% You allready have %i Health!",TAG,get_pcvar_num(MAXHEALTH))
			}
			
		}
	}
	else
	{
		if(get_pcvar_num(MODE) != 1)
			client_print(id,print_chat,"%s Call Medic is disabled. Sorry!")
		else
		{
			new Seconds = PlayerReload[id] - time()
			client_print(id,print_chat,"%s You recently called medic. Please wait %i seconds..",TAG,Seconds)	
		}
	}
	return PLUGIN_HANDLED;
}

stock fm_cs_set_user_money(id,money,flash=1)
 {
     set_pdata_int(id,OFFSET_CSMONEY,money,OFFSET_LINUX);

     message_begin(MSG_ONE,get_user_msgid("Money"),{0,0,0},id);
     write_long(money);
     write_byte(flash);
     message_end();
 }

 stock fm_cs_get_user_money(id)
 {
     return get_pdata_int(id,OFFSET_CSMONEY,OFFSET_LINUX);
 }
Image
Image
Image
RoyalServer
User avatar
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3560
Joined: 02 Apr 2012, 16:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 797 times
Been thanked: 607 times

18 Jun 2014, 20:40

| Afiseaza codul
[code]/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Call Medic"
#define VERSION "0.7"
#define AUTHOR "Grinf4ce"
#define TAG "[MEDIC - HNS.LEGENDCS.COM]"

/* ChatColor */
enum Color { NORMAL = 1, GREEN, TEAM_COLOR, GREY, RED, BLUE, }
new TeamName[][] = { "", "TERRORIST", "CT", "SPECTATOR" }

#if cellbits == 32
   #define OFFSET_CSMONEY  115
#else
   #define OFFSET_CSMONEY  140
#endif
#define OFFSET_LINUX      5

new MODE,REG_HEALTH, MAXHEALTH, COSTS,SHOUT, MESSAGE, COOLDOWN
new PlayerReload[33]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_cvar("medic_version",VERSION,FCVAR_SERVER);
	set_cvar_string("medic_version",VERSION);
	
	/* Register CVARs */
	MODE = register_cvar("medic_enabled","1")				/* Mode 1: On ;; Mode 0: Off */	
	REG_HEALTH = register_cvar("medic_health","20")				// How many Health you get instantly?
	
	MAXHEALTH = register_cvar("medic_maxhp","100")				// Maximal HP for everyone	
	COSTS = register_cvar("medic_costs","2000")				// How many costs medic?
	SHOUT = register_cvar("medic_shout","1")				// Shout Medic if you buy medic?
	MESSAGE = register_cvar("medic_message","1")				// Write a Message if you buy medic?
	COOLDOWN = register_cvar("medic_cooldown","10")				// Cooldown-Time in Seconds
	
	/* Register Commands */
	register_clcmd("/medic","call_medic",ADMIN_ALL)
	register_clcmd("medic","call_medic",ADMIN_ALL)
	register_clcmd("say /medic","call_medic",ADMIN_ALL)
	register_clcmd("say medic","call_medic",ADMIN_ALL)
	register_clcmd("say_team /medic","call_medic",ADMIN_ALL)
	register_clcmd("say_team medic","call_medic",ADMIN_ALL)
}

public plugin_precache() {
	precache_sound("medic.wav")
}

public client_connect(id) {
	PlayerReload[id] = 0
}

public client_disconnect(id) {
	PlayerReload[id] = 0
}

public call_medic(id) {
	/* Mods and Stuff */
	if(get_pcvar_num(MODE) == 1 && PlayerReload[id] < time())
	{
		new ActuellHP = get_user_health(id);
		new ActuellMoney = fm_cs_get_user_money(id);
		
		if(ActuellMoney < get_pcvar_num(COSTS))
		{
			ColorChat( id, RED, "^x04%s^x01 Nu ai destui bani pentru a chema medicul!", TAG )
		}
		else
		{
			if(ActuellHP < get_pcvar_num(MAXHEALTH))
			{
				/* Shout if activated */
				/* Write message if activated */
				new playerCount, i, players[32], name[33];
				get_players(players, playerCount, "ach");
				get_user_name(id,name,32)
					
				for(i=1; i<=playerCount; i++)
				{
					if(get_user_team(id) == get_user_team(i))
					{
						if(get_pcvar_num(MESSAGE) == 1)
						{
							ColorChat( i, RED, "^x03%s^x01 (hNs):Medic ?!",name )
							
							if(get_pcvar_num(SHOUT) == 1)
							{
								engfunc(EngFunc_EmitSound, i, CHAN_ITEM, "medic.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
							}
						}						
					}

				}

				new Float:Lebenplus = get_pcvar_float(REG_HEALTH);
				
				if(ActuellHP + Lebenplus > get_pcvar_num(MAXHEALTH))
				{
					set_pev(id,pev_health,get_pcvar_float(MAXHEALTH))
				}
				else
				{
					set_pev(id,pev_health,ActuellHP + Lebenplus);
				}
				FadeScreen(  id,  0.5,  255, 25, 25, 100 );
				PlayerReload[id] = time() + get_pcvar_num(COOLDOWN)		/* Activate Reload */
				fm_cs_set_user_money(id,ActuellMoney-get_pcvar_num(COSTS),1)	/* Pay.. */

			}
			else
			{
				ColorChat( id, RED, "^x04%s^x01 Ai deja^x03 %i^x01 HP!", TAG, get_pcvar_num( MAXHEALTH ) )
			}
			
		}
	}
	else
	{
		if(get_pcvar_num(MODE) != 1)
			ColorChat( id, RED, "^x04%s^x01 Ne pare rau, dar functia medic este dezactivata!" )
		else
		{
			new Seconds = PlayerReload[id] - time()
			ColorChat( id, RED, "^x04%s^x01 Ai chemat prea des medicul. Asteapta^x03 %i^x01 secunde..", TAG, Seconds )	
		}
	}
	return PLUGIN_HANDLED;
}

stock fm_cs_set_user_money(id,money,flash=1)
 {
     set_pdata_int(id,OFFSET_CSMONEY,money,OFFSET_LINUX);

     message_begin(MSG_ONE,get_user_msgid("Money"),{0,0,0},id);
     write_long(money);
     write_byte(flash);
     message_end();
 }

 stock fm_cs_get_user_money(id)
 {
     return get_pdata_int(id,OFFSET_CSMONEY,OFFSET_LINUX);
 }
 
 FadeScreen( id, const Float:fSeconds, const iRed, const iGreen, const iBlue, const iAlpha )
{      
	message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short( floatround( 4096.0 * fSeconds, floatround_round ) );
	write_short( floatround( 4096.0 * fSeconds, floatround_round ) );
	write_short( 0x0000 );
	write_byte( iRed );
	write_byte( iGreen );
	write_byte( iBlue );
	write_byte( iAlpha );
	message_end( );

}

ColorChat(id, Color:type, const msg[], {Float, Sql, Result, _}:...) {
	if(!get_playersnum())
		return;
	
	new message[256];

	switch(type) {
		case NORMAL: {
			message[0] = 0x01;
		}
		case GREEN: {
			message[0] = 0x04;
		}
		default: {
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	message[192] = '^0';

	new team, ColorChange, index, MSG_Type;
	
	if(id) {
		MSG_Type = MSG_ONE;
		index = id;
	} else {
		index = FindPlayer();
		MSG_Type = MSG_ALL;
	}
	
	team = get_user_team(index);
	ColorChange = ColorSelection(index, MSG_Type, type);

	ShowColorMessage(index, MSG_Type, message);
		
	if(ColorChange) {
		Team_Info(index, MSG_Type, TeamName[team]);
	}
}

ShowColorMessage(id, type, message[]) {
	static bool:saytext_used;
	static get_user_msgid_saytext;
	if(!saytext_used) {
		get_user_msgid_saytext = get_user_msgid("SayText");
		saytext_used = true;
	}

	message_begin(type, get_user_msgid_saytext, _, id);
	write_byte(id)		
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[]) {
	static bool:teaminfo_used;
	static get_user_msgid_teaminfo;
	if(!teaminfo_used) {
		get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
		teaminfo_used = true;
	}

	message_begin(type, get_user_msgid_teaminfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

ColorSelection(index, type, Color:Type) {
	switch(Type) {
		case RED: {
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE: {
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY: {
			return Team_Info(index, type, TeamName[0]);
		}
	}

	return 0;
}

FindPlayer() {
	new i = -1;

	while(i <= get_maxplayers()) {
		if(is_user_connected(++i))
			return i;
	}

	return -1;
}[/code]
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
MarioDaniel
Membru, skill 0
Membru, skill 0
Posts: 88
Joined: 18 Jun 2014, 16:43
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: hnsip.zapto.org
Fond eXtream: 0
Has thanked: 22 times
Contact:

19 Jun 2014, 02:09

Merge perfect MULTUMESC .
Ai de la mine un Multumesc!
Image
Image
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot], Dot [Bot] and 15 guests