Furien_vip errors

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Mota
Membru, skill 0
Membru, skill 0
Posts: 26
Joined: 10 Dec 2013, 12:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

15 Dec 2013, 09:41

salut am si eu o problema la un furien_vip deci am sma la el cand il compilez nu imi da eroare nik merge foarte bine dar cand il bag pe sv imi da eroari in logs ceva de gen [AMXX] Displaying debug trace (plugin "furien_vip.amxx")
L 12/10/2013 - 10:56:40: [AMXX] Run time error 4: index out of bounds
L 12/10/2013 - 10:56:40: [AMXX] [0] ye22m0hh.sma.p::Fwd_AddToFullPack (line 221)
FURIEN2.ANZO.RO | Manager: MoTaN:)FuMaT
Rapidserver
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

15 Dec 2013, 11:01

Baga debug dupa furien_vip.amxx

Asa

Code: Select all

furien_vip.amxx debug
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

15 Dec 2013, 11:03

GhosT *** wrote:Baga debug dupa furien_vip.amxx

Asa

Code: Select all

furien_vip.amxx debug
Tu esti pe langa. Nu vezi ca a pus?
Posteaza sursa pluginului.
Contact: Activitate scazuta.
Mota
Membru, skill 0
Membru, skill 0
Posts: 26
Joined: 10 Dec 2013, 12:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

15 Dec 2013, 11:09

FURIEN2.ANZO.RO | Manager: MoTaN:)FuMaT
User avatar
Doctor whO? <3
Membru, skill +2
Membru, skill +2
Posts: 881
Joined: 21 Jun 2013, 11:40
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Has thanked: 99 times
Been thanked: 18 times
Contact:

15 Dec 2013, 19:58

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <colorchat>

#pragma semicolon 1

const MAX_PLAYERS = 32;

static Author[] = "eNd.";

static Plugin[] = "Furien2 VIP";

static TAG[] = "[VIP]";

enum _: g_iCvars
{
	cvar_furien_messages,
	cvar_furien_bind,
	cvar_furien_flags,
	cvar_ap_value,
	cvar_hp_value,
	cvar_lifesteal_value,
	cvar_damage_value,
	cvar_money_value,
	cvar_limita

};
new	\	
		g_AllCvars	[ g_iCvars ]			,
		g_iLimita	[ MAX_PLAYERS + 1 ]		,
		g_iWeapon	[ MAX_PLAYERS + 1 ][4]		,
		g_iPowerT	[ MAX_PLAYERS + 1 ][3]		,
		g_iPowerCT	[ MAX_PLAYERS + 1 ][3]		;
		

new	const Ak47Models[][] = { "models/p_anzo_ak47.mdl", "models/v_anzo_ak47.mdl" };

new	const DeagleModels[][] = { "models/p_anzo_deagle.mdl", "models/v_anzo_deagle.mdl" };

new	const KatanaModels[][] = { "models/p_katana.mdl", "models/v_katana.mdl" };

new	const KSoundList[][] = { "katana/katana_deploy1.wav", "katana/katana1.wav", "katana/katana2.wav", "katana/katana2.wav",
			     "katana/katana_hwall.wav", "katana/katana_slash1.wav" , "katana/katana_slash1.wav", "katana/katana_stab.wav" };

new	const szPickSound[] = { "items/9mmclip1.wav" };	

public plugin_init() {
	register_plugin(Plugin, "0.2.beta", Author);
	
	register_clcmd("say", "hook_say");
	
	register_clcmd("say_team", "hook_say");

	register_forward(FM_EmitSound, "sound_emit");
	register_forward(FM_AddToFullPack, "Fwd_AddToFullPack", 1);
	register_forward(FM_PlayerPreThink, "Fwd_PlayerPreThink"); 

	register_event("CurWeapon", "CurWeapon", "be", "1=1");
	register_event("NVGToggle", "NVGToggle", "be");
	register_event("ScreenFade", "ScreenFade", "b", "7=255");

   	RegisterHam(Ham_TakeDamage, "player", "PlayerDamage");
	RegisterHam(Ham_Spawn, "player", "Ham_PlayerSpawn", 1);

}
public hook_say(id) {
	static iArg[192];
	
	read_args(iArg, sizeof(iArg) - 1);
	
	remove_quotes(iArg);
	
	if(szFlags(id) & get_pcvar_flags(g_AllCvars[cvar_furien_flags]) )
		if( (containi(iArg, "vipmenu") != -1) || (containi(iArg, "vm") != -1) || (containi(iArg, "furienvip") != -1))
		{		
			replace( iArg , sizeof( iArg ) - 1, "/", "" );	
			set_task( 0.1 , "VipMenu" , id);
		}

	return 0;
	
}
new g_Kamikaze;
public plugin_precache()
{
	g_AllCvars[ cvar_furien_messages ] = register_cvar("furien_messages", "1");
	g_AllCvars[ cvar_furien_bind ] = register_cvar("furien_bind", "1");
	g_AllCvars[ cvar_furien_flags ] = register_cvar("furien_flags", "t");
	g_AllCvars[ cvar_hp_value ] = register_cvar("furien_health", "250");
	g_AllCvars[ cvar_ap_value ] = register_cvar("furien_armor", "250");
	g_AllCvars[ cvar_lifesteal_value ] = register_cvar("furien_stealhp", "10");
	g_AllCvars[ cvar_damage_value ] = register_cvar("furien_damage", "15");
	g_AllCvars[ cvar_money_value ] = register_cvar("furien_money", "16000");
	g_AllCvars[ cvar_limita ] = register_cvar("furien_limita", "1");
	
	static i;
	for(i = 0; i <= charsmax(KSoundList); i++)
		precache_sound(KSoundList);

	for(i = 0; i < sizeof(KatanaModels); i++)
		precache_model(KatanaModels);

	for(i = 0; i < sizeof(Ak47Models); i++)
		precache_model(Ak47Models);

	for(i = 0; i < sizeof(DeagleModels); i++)
		precache_model(DeagleModels);

	precache_sound(szPickSound);
}
public client_putinserver(id)
{
	if(get_pcvar_num(g_AllCvars[cvar_furien_messages]))
		set_task(1.0, "client_putinserver_vip", id);

	if(get_pcvar_num(g_AllCvars[cvar_furien_bind]))
		set_task(1.5, "client_set_binds", id);
	
	return 1;
	
}
public client_disconnect(id)
{
	if(get_pcvar_num(g_AllCvars[cvar_furien_messages]))
		set_task(1.0, "client_disconnect_vip", id);

	return 1;
	
}
public client_set_bind(id)
{
	if(szFlags(id) & get_pcvar_flags(g_AllCvars[cvar_furien_flags]) )
	{
		client_cmd(id, "bind p say /furienvip");
		ColorChat(id, GREEN, "%s^x03 %s^x01 ai fost bindat apasa^x03 p ^x01", TAG, szName(id));
	}
	
	return 1;
}
public client_putinserver_vip(id)
{
	if(szFlags(id) & get_pcvar_flags(g_AllCvars[cvar_furien_flags]) )
		ColorChat(id, GREEN, "%s^x03 %s^x01 a intrat pe^x03 %s ^x01", TAG, szName(id), szHost());
		
	return 1;
}

public client_disconnect_vip(id)
{
	if(szFlags(id) & get_pcvar_flags(g_AllCvars[cvar_furien_flags]) )
		ColorChat(id, GREEN, "%s^x03 %s^x01 a iesit de pe^x03 %s ^x01", TAG, szName(id), szHost());

	return 1;
}

new const oldknife_sounds[][] =
{
	"weapons/knife_deploy1.wav",   
	"weapons/knife_hit1.wav",   
	"weapons/knife_hit2.wav",    
	"weapons/knife_hit3.wav",    
	"weapons/knife_hit4.wav",    
	"weapons/knife_hitwall1.wav",  
	"weapons/knife_slash1.wav",    
	"weapons/knife_slash2.wav",    
	"weapons/knife_stab.wav"    
};
public sound_emit(const id, const channel, const sample[])
{
	if(is_user_connected(id) && is_user_alive(id))
		if(g_iWeapon[id][3])
		{
			for(new i = 0; i < sizeof KSoundList; i++)
			{
				if(equal(sample, oldknife_sounds))
				{
					emit_sound(id, channel, KSoundList, 1.0, ATTN_NORM, 0, PITCH_NORM);
					return FMRES_SUPERCEDE;
				}
			}
		}

	return FMRES_IGNORED;
}
public Fwd_PlayerPreThink(id)  
{ 
	if(g_iPowerT[id][2])
	{
		new button = get_user_button(id); 
					     
		if(button & IN_USE )
			explode_me(id);	
	}

	return FMRES_IGNORED;

}  
public Ham_PlayerSpawn(const id)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		g_iLimita[id] = 0;		
		g_iWeapon[id][1] = 0;	
		g_iWeapon[id][2] = 0;		
		g_iPowerT[id][1] = 0;
		g_iWeapon[id][3] = 0;		
		g_iPowerT[id][2] = 0;		
		g_iPowerCT[id][1] = 0;
		g_iPowerCT[id][2] = 0;
		cs_set_user_nvg(id,false);
	}
}
public Fwd_AddToFullPack(es_handle, e, ent, host, hostflags, player, pSet)
{
	if(player && is_user_alive(host))
	{
		if(g_iPowerCT[1][host])
		{
			static CsTeams:team; team = cs_get_user_team(ent);
			static CsTeams:teamhost; teamhost = cs_get_user_team(host);
			static color[3];
			
			switch (team)
			{
				case CS_TEAM_CT:
				{
					color[0] = 0;
					color[1] = 0;
					color[2] = 255;
				}
				case CS_TEAM_T:
				{
					color[0] = 255;
					color[1] = 0;
					color[2] = 0;
				}
			}
			
			if(team != teamhost)
			{
				set_es(es_handle, ES_RenderFx, 19);
				set_es(es_handle, ES_RenderColor, color);
				set_es(es_handle, ES_RenderMode, 0);
				set_es(es_handle, ES_RenderAmt, 25);
			}
		}
	}
	
	return FMRES_IGNORED;
}

public NVGToggle(id)
	g_iPowerCT[1][id] = read_data(1);

public ScreenFade(id){
	if(g_iPowerCT[id][2] == 1 && is_user_alive(id))
	{
		message_begin(MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), { 0, 0, 0 }, id );
		write_short(0);
		write_short(0);
		write_short(0);
		write_byte(0);
		write_byte(0);
		write_byte(0);
		write_byte(0);
		message_end();
	}
	return 0;
}

public CurWeapon(id)
{
	new szWeapon = get_user_weapon( id );
	if(is_user_alive(id))
	{
		if(szWeapon == CSW_KNIFE && g_iWeapon[id][3])
		{
			set_pev(id, pev_viewmodel2,KatanaModels[1]);
			set_pev(id, pev_weaponmodel2,KatanaModels[0]);
		}
		if(szWeapon == CSW_AK47 && g_iWeapon[id][1])
		{
			set_pev(id, pev_viewmodel2,Ak47Models[1]);
			set_pev(id, pev_weaponmodel2,Ak47Models[0]);
		}
		if(szWeapon == CSW_DEAGLE && g_iWeapon[id][2])
		{
			set_pev(id, pev_viewmodel2, DeagleModels[1]);
			set_pev(id, pev_weaponmodel2,DeagleModels[0]);
		}
	}
}

public PlayerDamage(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
	new szWeapon = get_user_weapon(iAttacker);

	if(!is_user_alive(iAttacker) || is_user_bot(iAttacker))
		return HAM_IGNORED;
   
	if(iInflictor == iAttacker)
	{
		new DVal = get_pcvar_num(g_AllCvars[cvar_damage_value]);
		if(g_iPowerT[iAttacker][1])
		{
			new LsVal = get_pcvar_num(g_AllCvars[cvar_lifesteal_value]);
			set_user_health(iAttacker, get_user_health(iAttacker) + LsVal);
			set_user_health(iVictim, get_user_health(iVictim) - LsVal);
		}
		
		if(szWeapon == CSW_KNIFE && g_iWeapon[iAttacker][3])
			SetHamParamFloat( 4, fDamage + DVal);
		
		if(szWeapon == CSW_AK47 && g_iWeapon[iAttacker][1])
			SetHamParamFloat( 4, fDamage + DVal);
		
		else if(szWeapon == CSW_DEAGLE && g_iWeapon[iAttacker][2])
			SetHamParamFloat( 4, fDamage + DVal);
		

	}
 	return HAM_HANDLED;
}

public VipMenu(id)
{
	if(!is_user_alive(id))
	{
		ColorChat(id, GREEN, "%s^x03 %s^x01 esti mort..", TAG, szName(id));
		return 1;
	}
	if(g_iLimita[id] < get_pcvar_num(g_AllCvars[cvar_limita]))
 	switch(cs_get_user_team(id))
	{
		case CS_TEAM_T:
		{
			new szText[555 char];
	
			formatex(szText, charsmax(szText), "\dFurien VIP^n \r%s", szName(id));
			new szMenu = menu_create(szText, "TSMenu_Submenu");
		
			formatex(szText, charsmax(szText), "\d+ \y[\w%d\y] \rHP",get_pcvar_num(g_AllCvars[cvar_hp_value]));
			menu_additem(szMenu, szText, "1", 0);

			formatex(szText, charsmax(szText), "\d+ \y[\w%d\y] \rAP",get_pcvar_num(g_AllCvars[cvar_ap_value]));
			menu_additem(szMenu, szText, "2", 0);

			formatex(szText, charsmax(szText), "\dNade \yPACK");
			menu_additem(szMenu, szText, "3", 0);

			formatex(szText, charsmax(szText), "\rKATANA!");
			menu_additem(szMenu, szText, "4", 0);

			formatex(szText, charsmax(szText), "\dLife \rSteal \y[\w%d/Hit\y]",get_pcvar_num(g_AllCvars[cvar_lifesteal_value]));
			menu_additem(szMenu, szText, "5", 0);

			formatex(szText, charsmax(szText), "\dKamikaze");
			menu_additem(szMenu, szText, "6", 0);

			menu_setprop(szMenu, MPROP_EXIT , MEXIT_ALL);
			menu_display(id, szMenu, 0);

		}
		case CS_TEAM_CT:
		{			
			new szTexts[555 char];

			formatex(szTexts, charsmax(szTexts), "\dFurien VIP^n \r%s", szName(id));
			new szMenus = menu_create(szTexts, "CTMenu_Submenu");
		
			formatex(szTexts, charsmax(szTexts), "\d+ \y[\w%d\y] \rHP",get_pcvar_num(g_AllCvars[cvar_hp_value]));
			menu_additem(szMenus, szTexts, "1", 0);

			formatex(szTexts, charsmax(szTexts), "\d+ \y[\w%d\y] \rAP",get_pcvar_num(g_AllCvars[cvar_ap_value]));
			menu_additem(szMenus, szTexts, "2", 0);
		
			formatex(szTexts, charsmax(szTexts), "\dAk47+Deagle\r[\yGOLD\r]");
			menu_additem(szMenus, szTexts, "3", 0);

			formatex(szTexts, charsmax(szTexts), "\rThermal \dNightVision");
			menu_additem(szMenus, szTexts, "4", 0);

   			formatex(szTexts, charsmax(szTexts), "\dNo Flash");
			menu_additem(szMenus, szTexts, "5", 0);

			formatex(szTexts, charsmax(szTexts), "\d+ \y[\w%d\y] \r$",get_pcvar_num(g_AllCvars[cvar_money_value]));
			menu_additem(szMenus, szTexts, "6", 0);

			menu_setprop(szMenus, MPROP_EXIT , MEXIT_ALL);
			menu_display(id, szMenus, 0);

		}
	}
	if(g_iLimita[id] == get_pcvar_num(g_AllCvars[cvar_limita]))
	{
		ColorChat(id, GREEN, "%s^x03 %s^x01 ai atins limita maxima(%d).", TAG, szName(id), get_pcvar_num(g_AllCvars[cvar_limita]));
		return 1;
			
	}
	return 1;
}

public CTMenu_Submenu(id, szMenus, item)
{
	if( item == MENU_EXIT || get_user_team(id) == 1)
	{
		menu_destroy(szMenus);
		return 1;
	}
	new data[6], iName[64];
	new access, callback;

	menu_item_getinfo(szMenus, item, access, data,5, iName, 63, callback);

	new key = str_to_num(data);

	switch(key)
	{
		case 1:
		{
			new HpVal = get_pcvar_num(g_AllCvars[cvar_hp_value]);
			g_iLimita[id] ++;
 			set_user_health(id, get_user_health(id) + HpVal);
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 +%d HP ^x01", TAG, szName(id), HpVal);
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
		case 2:
		{
 			new ApVal = get_pcvar_num(g_AllCvars[cvar_ap_value]);
			g_iLimita[id] ++;
 			set_user_armor(id, get_user_armor(id) + ApVal);
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 +%d AP ^x01", TAG, szName(id), ApVal);
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
		case 3:
		{
			g_iLimita[id] ++;
			//strip_user_weapons(id);
			g_iWeapon[id][1] = 1;
			g_iWeapon[id][2] = 1;
			give_item(id, "weapon_knife");
			give_item(id, "weapon_ak47");
			give_item(id, "weapon_deagle");
			cs_set_user_bpammo(id, CSW_AK47, 120);
			cs_set_user_bpammo(id, CSW_DEAGLE, 70);
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 ak47+deagle ^x01", TAG, szName(id));
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
		case 4:
		{
			g_iLimita[id] ++;
			g_iPowerCT[id][1] = 1;
			cs_set_user_nvg(id,true);
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 nightvision thermal ^x01", TAG, szName(id));
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
		case 5:
		{
			g_iLimita[id] ++;
			g_iPowerCT[id][2] = 1;
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 anti-flash mask ^x01", TAG, szName(id));
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
		case 6:
		{
 			new MoneyVal = get_pcvar_num(g_AllCvars[cvar_money_value]);
			g_iLimita[id] ++;
 			cs_set_user_money(id , min((cs_get_user_money(id) + MoneyVal), 16000));
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 +%d money ^x01", TAG, szName(id), MoneyVal);
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
	}
	return 1;
}

public TSMenu_Submenu(id, szMenu, item)
{
	if( item == MENU_EXIT || get_user_team(id) != 1)
	{
		menu_destroy(szMenu);
		return 1;
	}
	new data[6], iName[64];

	new access, callback;

	menu_item_getinfo(szMenu, item, access, data,5, iName, 63, callback);

	new key = str_to_num(data);

	switch(key)
	{
		case 1:
		{
			new HpVal = get_pcvar_num(g_AllCvars[cvar_hp_value]);
			g_iLimita[id] ++;
 			set_user_health(id, get_user_health(id) + HpVal);
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 +%d HP ^x01", TAG, szName(id), HpVal);
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
		case 2:
		{
 			new ApVal = get_pcvar_num(g_AllCvars[cvar_ap_value]);
			g_iLimita[id] ++;
 			set_user_armor(id, get_user_armor(id) + ApVal);
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 +%d AP ^x01", TAG, szName(id), ApVal);
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
		case 3:
		{
			if(pev(id, pev_weapons) & (1<<CSW_HEGRENADE) || pev(id, pev_weapons) & (1<<CSW_FLASHBANG) || pev(id, pev_weapons) & (1<<CSW_SMOKEGRENADE))
			{
				ColorChat(id, GREEN, "%s^x03 %s^x01 scapa intai de toate ^x03  grenade^x01", TAG, szName(id));
				return 1;
		
			}
			else
			{
				g_iLimita[id] ++;
				give_item(id, "weapon_hegrenade");
				give_item(id, "weapon_flashbang");
				give_item(id, "weapon_smokegrenade");
				ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 nade pack ^x01", TAG, szName(id));
				emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
			}
		}
		case 4:
		{
			g_iLimita[id] ++;
			//strip_user_weapons(id);
			g_iWeapon[id][3] = 1;
			give_item(id, "weapon_knife");
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 KATANA ^x01", TAG, szName(id));
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
		case 5:
		{
			g_iLimita[id] ++;
			g_iPowerT[id][1] = 1;
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales^x03 life steal ^x01", TAG, szName(id));
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}
		case 6:
		{
			g_iLimita[id] ++;
			g_iPowerT[id][2] = 1;
			ColorChat(id, GREEN, "%s^x03 %s^x01 ai ales kamikaze apasa pe ^x03 e ^x01", TAG, szName(id));
			emit_sound(id, CHAN_ITEM, szPickSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
		}		
	}
	return 1;
}

public explode_me(id) {
	new Float:explosion[3];
	pev(id, pev_origin, explosion);

	user_kill(id);   
	g_iPowerT[id][2] = 0;  

	// create explosion
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(TE_EXPLOSION);
	write_coord(floatround(explosion[0]));
	write_coord(floatround(explosion[1]));
	write_coord(floatround(explosion[2]));
	write_short(g_Kamikaze);
	write_byte(30);
	write_byte(30);
	write_byte(0);
	message_end();
	emit_sound(0, CHAN_ITEM, "weapons/explode3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
	fm_radius_damage(id, explosion, 1000.0, 400.0, "grenade");
}

stock fm_radius_damage(id, Float:orig[3], Float:dmg , Float:rad, wpnName[]="") {
	new szClassname[33], Float:Health;
	static Ent;
	Ent = -1;
	while((Ent = engfunc(EngFunc_FindEntityInSphere, Ent, orig, rad))) {
		pev(Ent,pev_classname,szClassname,32);
		if(equali(szClassname, "player") 
		&& is_user_connected(Ent) 
		&& is_user_alive(Ent) )
		{
			pev(Ent, pev_health, Health);
			Health -= dmg;
			
			new szName[32], szName1[32];
			get_user_name(Ent, szName, charsmax(szName));
			get_user_name(id, szName1, charsmax(szName1));
			
			if(Health <= 0.0) 
				createKill(Ent, id, wpnName);
			else set_pev(Ent, pev_health, Health);
		}
	}             
}

stock szFlags(id)
{
	new sz_Flags = get_user_flags(id);

	return sz_Flags;
}
stock szHost()
{
	new sz_Host[64];
	
	get_cvar_string("hostname", sz_Host ,charsmax(sz_Host));
	
	return sz_Host;
}
stock szName(id)
{
	new sz_Name[33];
	
	get_user_name(id, sz_Name, charsmax(sz_Name));
	
	return sz_Name;
}
stock createKill(id, attacker, weaponDescription[]) {
	new szFrags, szFrags2;
	
	if(id != attacker) {
		szFrags = get_user_frags(attacker);
		set_user_frags(attacker, szFrags + 1);
		logKill(attacker, id, weaponDescription);
		   
		//Kill the victim and block the messages
		set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE);
		set_msg_block(get_user_msgid("ScoreInfo"),BLOCK_ONCE);
		user_kill(id);
		  
		//user_kill removes a frag, this gives it back
		szFrags2 = get_user_frags(id);
		set_user_frags(id, szFrags2 + 1);
		  
		//Replaced HUD death message
		message_begin(MSG_ALL, get_user_msgid("DeathMsg"),{0,0,0},0);
		write_byte(attacker);
		write_byte(id);
		write_byte(0);
		write_string(weaponDescription);
		message_end();
		  
		//Update killers scorboard with new info
		message_begin(MSG_ALL, get_user_msgid("ScoreInfo"));
		write_byte(attacker);
		write_short(szFrags);
		write_short(get_user_deaths(attacker));
		write_short(0);
		write_short(get_user_team(attacker));
		message_end();
		  
		//Update victims scoreboard with correct info
		message_begin(MSG_ALL, get_user_msgid("ScoreInfo"));
		write_byte(id);
		write_short(szFrags2);
		write_short(get_user_deaths(id));
		write_short(0);
		write_short(get_user_team(id));
		message_end();
		
		new szName[32], szName1[32];
		get_user_name(id, szName, charsmax(szName));
		get_user_name(attacker, szName1, charsmax(szName1));
	}
}

// stock for log kill
stock logKill(id, victim, weaponDescription[] ) {
	new namea[32],namev[32],authida[35],authidv[35],teama[16],teamv[16];
   
	//Info On Attacker
	get_user_name(id,namea,charsmax(namea));
	get_user_team(id,teama,15);
	get_user_authid(id,authida,34);
   
	//Info On Victim
	get_user_name(victim,namev,charsmax(namev));
	get_user_team(victim,teamv,15);
	get_user_authid(victim,authidv,34);
   
	//Log This Kill
	if(id != victim)
		log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",
		namea,get_user_userid(id),authida,teama,namev,get_user_userid(victim),authidv,teamv, weaponDescription );
	else
		log_message("^"%s<%d><%s><%s>^" committed suicide with ^"%s^"",
		namea,get_user_userid(id),authida,teama, weaponDescription );
}


Sursa lui.
In caz ca ii e lene cuiva :)) :P
Mota
Membru, skill 0
Membru, skill 0
Posts: 26
Joined: 10 Dec 2013, 12:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

15 Dec 2013, 21:45

Ai rezolvat? nu mai da erori in logs?
FURIEN2.ANZO.RO | Manager: MoTaN:)FuMaT
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests