Page 1 of 1

Problema

Posted: 24 Jan 2019, 12:21
by floringold01
Salut am aceasta problema
L 01/23/2019 - 18:18:25: Start of error session.
L 01/23/2019 - 18:18:25: Info (map "fy_snow") (file "addons/amxmodx/logs/error_20190123.log")
L 01/23/2019 - 18:18:25: [CSTRIKE] Non-player entity 0 out of range
L 01/23/2019 - 18:18:25: [AMXX] Displaying debug trace (plugin "csdm_refill.amxx")
L 01/23/2019 - 18:18:25: [AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
L 01/23/2019 - 18:18:25: [AMXX] [0] sj8k9jyk.sma.p::client_death (line 93)
L 01/23/2019 - 19:21:08: [CSTRIKE] Non-player entity 0 out of range
L 01/23/2019 - 19:21:08: [AMXX] Displaying debug trace (plugin "csdm_refill.amxx")
L 01/23/2019 - 19:21:08: [AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
L 01/23/2019 - 19:21:08: [AMXX] [0] sj8k9jyk.sma.p::client_death (line 93)
L 01/23/2019 - 22:20:37: [CSTRIKE] Non-player entity 0 out of range
L 01/23/2019 - 22:20:37: [AMXX] Displaying debug trace (plugin "csdm_refill.amxx")
L 01/23/2019 - 22:20:37: [AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
L 01/23/2019 - 22:20:37: [AMXX] [0] sj8k9jyk.sma.p::client_death (line 93)

Cum o rezolv ? am pus in plugin ini debug dar nimica

Re: Problema

Posted: 24 Jan 2019, 13:25
by levin
dacă pui debug în fața unui plugin,asta nu înseamnă că nu va mai avea erori de afișat

Re: Problema

Posted: 24 Jan 2019, 13:45
by Pymbor
Daca nu puteti oferii o rezolvare , nu mai postati. :)

Re: Problema

Posted: 24 Jan 2019, 13:49
by floringold01
Bun si cum o rezolv?

Re: Problema

Posted: 24 Jan 2019, 13:55
by levin
verifici linia 93 din publicul death,ca atacatorul sau/și victima să fie conectați/în viață(depinde ce eveniment se întâmplă)

Re: Problema

Posted: 24 Jan 2019, 14:18
by floringold01
nu intaleg nimic

Re: Problema

Posted: 24 Jan 2019, 22:15
by Pymbor
Lasa si tu sursa ( fisierul .sma ) sa te putem ajuta si noi.

Re: Problema

Posted: 25 Jan 2019, 03:13
by floringold01

Code: Select all

#include <amxmodx>
#include <csdm>
#include <cstrike>
#include <fakemeta>

new const g_weapons[] =
{
	CSW_P228,
	CSW_SCOUT,
	CSW_XM1014,
	CSW_MAC10,
	CSW_AUG,
	CSW_ELITE,
	CSW_FIVESEVEN,
	CSW_UMP45,
	CSW_SG550,
	CSW_GALI,
	CSW_GALIL,
	CSW_FAMAS,
	CSW_USP,
	CSW_GLOCK18,
	CSW_AWP,
	CSW_MP5NAVY,
	CSW_M249,
	CSW_M3,
	CSW_M4A1,
	CSW_TMP,
	CSW_G3SG1,
	CSW_DEAGLE,
	CSW_SG552,
	CSW_AK47,
	CSW_P90
}

new const g_max_clip[] =
{
	13,
	10,
	7,
	30,
	30,
	30,
	20,
	25,
	30,
	35,
	35,
	25,
	12,
	20,
	10,
	30,
	100,
	8,
	30,
	30,
	20,
	7,
	30,
	30,
	50
}

new const g_other_weapons[] =
{
	CSW_KNIFE,
	CSW_HEGRENADE,
	CSW_C4
}

public plugin_init()
	register_plugin("CSDM Refill", "1.0", "Radiance")

public client_death(killer, victim, wpnindex, hitplace, TK)
{
	if (!csdm_get_ffa() && TK)
		return

	for (new a = 0; a < sizeof (g_other_weapons); a++)
		if (wpnindex == g_other_weapons[a])
			return

	new weapon = fm_get_weapon_ent(killer, wpnindex)

	for (new a = 0; a < sizeof (g_weapons); a++)
		if (wpnindex == g_weapons[a])
		{
			new ammo = get_weapon_maxclip(wpnindex)

			if (ammo)
			{
				client_cmd(killer, "spk ^"items/9mmclip1.wav^"")
				cs_set_weapon_ammo(weapon, ammo)
			}
			return

		}
}

get_weapon_maxclip(wpnid = 0)
{
	for (new a = 0; a < sizeof (g_weapons); a++)
		if (wpnid == g_weapons[a])
			return g_max_clip[a]

	return false
}

fm_get_weapon_ent(id, wpnid = 0)
{
	new name[32]

	if(wpnid)
		get_weaponname(wpnid, name, 31)

	if (!equal(name, "weapon_", 7))
		format(name, sizeof (name) - 1, "weapon_%s", name)

	return fm_find_ent_by_owner(get_maxplayers(), name, id)
}

fm_find_ent_by_owner(id, const classname[], owner, jghgtype = 0)
{
	new strtype[16] = "classname"
	new ent = id

	switch (jghgtype)
	{
		case 1: strtype = "target"
		case 2: strtype = "targetname"
	}

	while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner)
	{
	}

	return ent
}

EDIT

Code: Select all

[code]L 01/25/2019 - 06:46:15: Start of error session.
L 01/25/2019 - 06:46:15: Info (map "fy_snow") (file "addons/amxmodx/logs/error_20190125.log")
L 01/25/2019 - 06:46:15: [AMXX] Invalid Plugin (plugin "csdm_refill.amxx")
[/code]

IMI APARE SI ACEASTA EROARE

Re: Problema

Posted: 25 Jan 2019, 12:49
by levin

Code: Select all

#include <amxmodx>
#include <csdm>
#include <cstrike>
#include <fakemeta>

new const g_weapons[] =
{
   CSW_P228,
   CSW_SCOUT,
   CSW_XM1014,
   CSW_MAC10,
   CSW_AUG,
   CSW_ELITE,
   CSW_FIVESEVEN,
   CSW_UMP45,
   CSW_SG550,
   CSW_GALI,
   CSW_GALIL,
   CSW_FAMAS,
   CSW_USP,
   CSW_GLOCK18,
   CSW_AWP,
   CSW_MP5NAVY,
   CSW_M249,
   CSW_M3,
   CSW_M4A1,
   CSW_TMP,
   CSW_G3SG1,
   CSW_DEAGLE,
   CSW_SG552,
   CSW_AK47,
   CSW_P90
}

new const g_max_clip[] =
{
   13,
   10,
   7,
   30,
   30,
   30,
   20,
   25,
   30,
   35,
   35,
   25,
   12,
   20,
   10,
   30,
   100,
   8,
   30,
   30,
   20,
   7,
   30,
   30,
   50
}

new const g_other_weapons[] =
{
   CSW_KNIFE,
   CSW_HEGRENADE,
   CSW_C4
}

public plugin_init()
   register_plugin("CSDM Refill", "1.0", "Radiance")

public client_death(killer, victim, wpnindex, hitplace, TK)
{
   if (!csdm_get_ffa() && TK||!is_user_alive(killer))
      return

   for (new a = 0; a < sizeof (g_other_weapons); a++)
      if (wpnindex == g_other_weapons[a])
         return

   new weapon = fm_get_weapon_ent(killer, wpnindex)

   for (new a = 0; a < sizeof (g_weapons); a++)
      if (wpnindex == g_weapons[a])
      {
         new ammo = get_weapon_maxclip(wpnindex)

         if (ammo)
         {
            client_cmd(killer, "spk ^"items/9mmclip1.wav^"")
            cs_set_weapon_ammo(weapon, ammo)
         }
         return

      }
}

get_weapon_maxclip(wpnid = 0)
{
   for (new a = 0; a < sizeof (g_weapons); a++)
      if (wpnid == g_weapons[a])
         return g_max_clip[a]

   return false
}

fm_get_weapon_ent(id, wpnid = 0)
{
   new name[32]

   if(wpnid)
      get_weaponname(wpnid, name, 31)

   if (!equal(name, "weapon_", 7))
      format(name, sizeof (name) - 1, "weapon_%s", name)

   return fm_find_ent_by_owner(get_maxplayers(), name, id)
}

fm_find_ent_by_owner(id, const classname[], owner, jghgtype = 0)
{
   new strtype[16] = "classname"
   new ent = id

   switch (jghgtype)
   {
      case 1: strtype = "target"
      case 2: strtype = "targetname"
   }

   while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner)
   {
   }

   return ent
}

Re: Problema

Posted: 25 Jan 2019, 17:15
by floringold01
mersi am sa revin cu edit daca merge sau nu

Re: Problema

Posted: 27 Jan 2019, 09:21
by floringold01
problema rezolvata t/c