Cerere cod refill [rezolvat]

Tutoriale scripting, cod si portiuni de cod.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Nimicitu`
Membru, skill +1
Membru, skill +1
Posts: 162
Joined: 01 Sep 2015, 13:42
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

03 Oct 2015, 23:03

Salut, doresc partea cu codul de incarcarea armei la vip dupa kill-ul făcut.

Mersi.
RoyalServer 2
Nimicitu`
Membru, skill +1
Membru, skill +1
Posts: 162
Joined: 01 Sep 2015, 13:42
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

07 Oct 2015, 14:11

# upp..
Nimicitu`
Membru, skill +1
Membru, skill +1
Posts: 162
Joined: 01 Sep 2015, 13:42
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

11 Oct 2015, 10:01

# upp, vă rog frumos, am nevoie de acest cod.
User avatar
EnTeR_
Membru, skill +2
Membru, skill +2
Posts: 577
Joined: 13 Sep 2014, 16:36
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 3 times
Been thanked: 29 times

11 Oct 2015, 13:25

Extras din 'csdm_refill'
| Afiseaza codul
#include <amxmodx>
#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 client_death(killer, victim, wpnindex, hitplace, TK)
{
if (!(get_user_flags ( killer ) & ADMIN_LEVEL_H ) )
return PLUGIN_HANDLED;

for (new a = 0; a < sizeof (g_other_weapons); a++)
	if (wpnindex == g_other_weapons[a])
		return PLUGIN_CONTINUE
	
	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 PLUGIN_CONTINUE
		
	}
	return PLUGIN_CONTINUE;
}

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
}
Discord: eyekon13
Nimicitu`
Membru, skill +1
Membru, skill +1
Posts: 162
Joined: 01 Sep 2015, 13:42
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

11 Oct 2015, 13:34

Este şi pentru vip ?
User avatar
EnTeR_
Membru, skill +2
Membru, skill +2
Posts: 577
Joined: 13 Sep 2014, 16:36
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 3 times
Been thanked: 29 times

11 Oct 2015, 13:37

In publicul client_death ai linia if (!(get_user_flags ( killer ) & ADMIN_LEVEL_H ) ), inlocuiesti cu accesul dorit de tine. In cazul actual este flag'ul 'T'.
Discord: eyekon13
Nimicitu`
Membru, skill +1
Membru, skill +1
Posts: 162
Joined: 01 Sep 2015, 13:42
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

11 Oct 2015, 14:19

Mersi.
Post Reply

Return to “Scripting”

  • Information