Cerere Modificare plugin refill_on_kill

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
RaFy1995
Membru, skill +1
Membru, skill +1
Posts: 418
Joined: 13 Feb 2016, 22:13
Detinator Steam: Da
CS Status: Respecta si vei fi Respectat !
SteamID: RaFy1995
Fond eXtream: 0
Has thanked: 195 times
Been thanked: 8 times

06 Aug 2017, 19:52

Salutare tuturor, am nevoie de ajutorul vostru sa rezolv o problema la pluginul refill_on_kill.amxx

Nu stiu de ce apare mereu la fiecare schimbare de harta o eroare in logs.

Desi am scris dupa numele pluginului debug

Code: Select all

L 08/06/2017 - 19:22:24: Start of error session.
L 08/06/2017 - 19:22:24: Info (map "awp_bycastor32") (file "addons/amxmodx/logs/error_20170806.log")
L 08/06/2017 - 19:22:24: [CSTRIKE] Non-player entity 0 out of range
L 08/06/2017 - 19:22:24: [AMXX] Displaying debug trace (plugin "refill_on_kill.amxx")
L 08/06/2017 - 19:22:24: [AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
L 08/06/2017 - 19:22:24: [AMXX]    [0] n65p6no1.sma.p::client_death (line 93)
Mentionez ca pluginul functioneaza doar ca imi apare aceasta eroare in loguri si nu stiu de ce, s-ar putea sa fie buguit ???

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
}
Image
RoyalServer 2
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3854
Joined: 24 Aug 2011, 12:24
Detinator Steam: Nu
CS Status:
Detinator server CS: ☯∴
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 595 times
Contact:

06 Aug 2017, 19:54

Evils-Powah | Afiseaza codul
#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
}
Nu îmi mai trimiteți PM pe forum! Nu merge să răspund
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
*Or!g!naL*
Fost moderator
Fost moderator
Posts: 1367
Joined: 16 Feb 2014, 16:28
Detinator Steam: Nu
CS Status: N-avem!
Detinator server CS: Zm.Darkcs.ro
Reputatie: Fost moderator ajutator
Has thanked: 3 times
Been thanked: 1 time

08 Aug 2017, 12:10

Ai modificat fisierele din modules? Daca da incearca sa le bagi pe cele default
Image
User avatar
RaFy1995
Membru, skill +1
Membru, skill +1
Posts: 418
Joined: 13 Feb 2016, 22:13
Detinator Steam: Da
CS Status: Respecta si vei fi Respectat !
SteamID: RaFy1995
Fond eXtream: 0
Has thanked: 195 times
Been thanked: 8 times

08 Aug 2017, 13:35

Am rezolvat deja, ma ajutat Adryyy :D
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests