eroare - call_medic[rezolvat!]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
mixatu
Membru, skill +2
Membru, skill +2
Posts: 680
Joined: 26 Apr 2012, 15:47
Detinator Steam: Da
SteamID: kzu1337
Reputatie: Membru Club eXtreamCS (1 luna)
Location: cstrike
Has thanked: 59 times
Been thanked: 29 times
Contact:

05 Sep 2012, 16:21

Da eroare la compilare. Vreo rezolvare? :)
Call_medic.sma | Afiseaza codul
/* Plugin generated by AMXX-Studio */

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

#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))
		{
			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( );

}
RoyalServer
User avatar
CamPagNe
Fost moderator
Fost moderator
Posts: 329
Joined: 12 Jun 2012, 15:20
Detinator Steam: Da
CS Status: Fuck yeah !
Reputatie: Fost Moderator ajutator
Has thanked: 13 times
Been thanked: 71 times

05 Sep 2012, 16:41

Ai nevoie de:
CC_ChatColor | Afiseaza codul
http://www.filehost.ro/28850495/CC_ColorChat_inc/
Trebui pus in scripting/include si va merge compilat.

Download AMXX:
Call Medic | Afiseaza codul
http://www.filehost.ro/28850497/call_medic_amxx/
User avatar
K1d0x
Fost moderator
Fost moderator
Posts: 800
Joined: 26 Feb 2012, 15:57
Detinator Steam: Da
CS Status: We Build Together ;3 RedFear
Detinator server CS: PuB.RedFear.Ro
SteamID: k1dox
Reputatie: Fost moderator ajutator
Location: Reșița
Been thanked: 152 times
Contact:

05 Sep 2012, 16:42

| 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]"

/* 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;
}
Image
32slots.net - Sursa ta de încredere de KIT-uri CS 1.6
RedFear.Ro România - | Afiseaza codul
Vă aştept cu un Register pe Forum
- Suntem în căutare de Dezvoltatori & Administratori :
HTML
PHP
MYSQL
C++
Ofer Server CS spre administrare | Afiseaza codul
Condiții : 
- Să dispui de timp liber
- Să ai cunoștințe AMXX & HLDS
Boostul este asigurat de către Mine (PM pentru. detalii)
[email protected]
User avatar
mixatu
Membru, skill +2
Membru, skill +2
Posts: 680
Joined: 26 Apr 2012, 15:47
Detinator Steam: Da
SteamID: kzu1337
Reputatie: Membru Club eXtreamCS (1 luna)
Location: cstrike
Has thanked: 59 times
Been thanked: 29 times
Contact:

05 Sep 2012, 21:44

Mersi k1d0x :)
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests