Results 1 to 7 of 7
  1. #1
    Senior Member Array
    Join Date
    Jun 2013
    Location
    K und K monarhija
    Karma
    17

    Default [CSDM] Refill ammo on kill

    Plugin name: Refill ammo on kill
    Plugin version: 1.0
    Plugin author: Radiance

    -Ukratko:
    Objavio sam ovaj plugin jer me 1000 ljudi dnevno pita za ovaj plugin i na fb i na pm i svuda, znaci smorili ste vise.Opet moram da kazem da nisam autor plugina da se neko ne napravi pametan.

    -Sta radi plugin?
    Kada igrac ubije drugog igraca, napuni mu se puska.

    SMA Code:

    Code:
    #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: Ako vam treba plugin koji puni pusku samo kad je headshoot, evo prepravljeno:

    Code:
    #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)
    			{
    				if(hitplace == HIT_HEAD) {
    					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
    }
    Last edited by DecaK; 03-10-2014 at 13:20.
    double penetration sadomazo satisfaction
    k'o svedski akcioni kada kazu action

    Quote Originally Posted by Skubishaa View Post
    Moze bit do mašine na kojoj je hostovan taj server.
    Ili ti je do napajanja neta tvog

  2. #2
    Senior Member Array
    Join Date
    Apr 2014
    Location
    Sarajevo
    Karma
    8

    Default

    Bolje bi bilo kada da HS da mu se napuni puska a za obican kill dovoljan je vampire :P

  3. #3
    Senior Member Array
    Join Date
    Jun 2013
    Location
    K und K monarhija
    Karma
    17

    Default

    Quote Originally Posted by m1re' View Post
    Bolje bi bilo kada da HS da mu se napuni puska a za obican kill dovoljan je vampire :P
    Evo ubaceno na prvi post.SMA:

    Code:
    #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)
    			{
    				if(hitplace == HIT_HEAD) {
    					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
    }
    double penetration sadomazo satisfaction
    k'o svedski akcioni kada kazu action

    Quote Originally Posted by Skubishaa View Post
    Moze bit do mašine na kojoj je hostovan taj server.
    Ili ti je do napajanja neta tvog

  4. #4
    Junior Member Array
    Join Date
    Jul 2013
    Karma
    0

    Default

    Welcome to the AMX Mod X 1.8.1-300 Compiler.
    Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

    /tmp/textiYwDry.sma(2) : fatal error 100: cannot read from file: "csdm"

    Compilation aborted.
    1 Error.

    Sta je fora?

  5. #5
    Senior Member Array
    Join Date
    Jun 2013
    Location
    K und K monarhija
    Karma
    17

    Default

    Quote Originally Posted by konzul View Post
    Welcome to the AMX Mod X 1.8.1-300 Compiler.
    Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

    /tmp/textiYwDry.sma(2) : fatal error 100: cannot read from file: "csdm"

    Compilation aborted.
    1 Error.

    Sta je fora?
    Moras imati taj modul csdm.ini, to ti je od DM-a modul koji povezuje taj plugin i DM Mod, samo ga nadji na netu kucaj download csdm.inc, ubaci u kompajler/ili online, i eto ga.
    double penetration sadomazo satisfaction
    k'o svedski akcioni kada kazu action

    Quote Originally Posted by Skubishaa View Post
    Moze bit do mašine na kojoj je hostovan taj server.
    Ili ti je do napajanja neta tvog

  6. #6
    Member Array
    Join Date
    Jan 2017
    Karma
    0

    Default

    Moze pomoc? sta se radi sa ovim code? Nikada nisam shvatao i taj php code... Uvek to ispisete

  7. #7
    Senior Member Array
    Join Date
    Oct 2014
    Location
    Crna Gora
    Age
    22
    Karma
    3

    Default

    Quote Originally Posted by SrEmAcc View Post
    Moze pomoc? sta se radi sa ovim code? Nikada nisam shvatao i taj php code... Uvek to ispisete
    To je u suštini plugin koji je postavljan u .SMA kako bi se vidio njegov sadrzaj.
    Da bi radio ovaj plugin na serveru moras ga prebaciti u .amxx preko compiler-a to mozes uraditi na sledecem linku:
    LINK
    |͇̿V͇̿I͇̿P͇̿|RedTube Arena 18+ [gameME]

    193.104.68.42:27022
    Connect



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •