Cerere functie !

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

24 Dec 2013, 22:37

Salut,exista vreo functie care daca o scriu in plugin iti arunca o anumita arma?
In afara de strip_user_weapons(id) ca asta ti le arunca pe toate :))
Rapidserver
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1771
Joined: 16 Jul 2011, 20:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Location: Bacău
Has thanked: 145 times
Been thanked: 388 times
Contact:

24 Dec 2013, 22:46

| Afiseaza codul
stock ham_strip_user_weapon(id, iCswId, iSlot = 0, bool:bSwitchIfActive = true)
{
	new iWeapon;
	if(!iSlot)
	{
		static const iWeaponsSlots[] = {
			-1,
			2, //CSW_P228
			-1,
			1, //CSW_SCOUT
			4, //CSW_HEGRENADE
			1, //CSW_XM1014
			5, //CSW_C4
			1, //CSW_MAC10
			1, //CSW_AUG
			4, //CSW_SMOKEGRENADE
			2, //CSW_ELITE
			2, //CSW_FIVESEVEN
			1, //CSW_UMP45
			1, //CSW_SG550
			1, //CSW_GALIL
			1, //CSW_FAMAS
			2, //CSW_USP
			2, //CSW_GLOCK18
			1, //CSW_AWP
			1, //CSW_MP5NAVY
			1, //CSW_M249
			1, //CSW_M3
			1, //CSW_M4A1
			1, //CSW_TMP
			1, //CSW_G3SG1
			4, //CSW_FLASHBANG
			2, //CSW_DEAGLE
			1, //CSW_SG552
			1, //CSW_AK47
			3, //CSW_KNIFE
			1 //CSW_P90
		}
		iSlot = iWeaponsSlots[iCswId];
	}

	const XTRA_OFS_PLAYER = 5;
	const m_rgpPlayerItems_Slot0 = 367;

	iWeapon = get_pdata_cbase(id, m_rgpPlayerItems_Slot0 + iSlot, XTRA_OFS_PLAYER);

	const XTRA_OFS_WEAPON = 4;
	const m_pNext = 42;
	const m_iId = 43;

	while(iWeapon > 0)
	{
		if(get_pdata_int(iWeapon, m_iId, XTRA_OFS_WEAPON) == iCswId)
		{
			break;
		}
		iWeapon = get_pdata_cbase(iWeapon, m_pNext, XTRA_OFS_WEAPON);
	}
	if(iWeapon > 0)
	{
		const m_pActiveItem = 373;
		if(bSwitchIfActive && get_pdata_cbase(id, m_pActiveItem, XTRA_OFS_PLAYER) == iWeapon)
		{
			ExecuteHamB(Ham_Weapon_RetireWeapon, iWeapon);
		}
		if(ExecuteHamB(Ham_RemovePlayerItem, id, iWeapon))
		{
			user_has_weapon(id, iCswId, 0);
			ExecuteHamB(Ham_Item_Kill, iWeapon);
			return 1;
		}
	}
	return 0;
}
Ex:

Code: Select all

ham_strip_user_weapon(id, CSW_KNIFE);
89.34.25.17:27015 - XMAS MOD
89.34.25.38:27015 - XMAS MOD
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

24 Dec 2013, 22:54

Fara stock nu merge? adica ma refer la o functie care sa nu necesite un public/stock s.a.m.d. cum e strip_user_weapon(id) .. exista? :-?
User avatar
PAWNTeam
Membru, skill 0
Membru, skill 0
Posts: 55
Joined: 02 Nov 2013, 20:17
Detinator Steam: Da
CS Status: No-one
Has thanked: 1 time
Been thanked: 6 times
Contact:

24 Dec 2013, 22:55

scosmynnnn wrote:Fara stock nu merge? adica ma refer la o functie care sa nu necesite un public/stock s.a.m.d. cum e strip_user_weapon(id) .. exista? :-?
pui functia aia si iti va merge cum vrei tu.. nu mereu exista ce vrei tu, asa ca faci.
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1771
Joined: 16 Jul 2011, 20:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Location: Bacău
Has thanked: 145 times
Been thanked: 388 times
Contact:

24 Dec 2013, 22:58

Nu exista alta cale, oricum asta nu arunca arma, ci o sterge.
89.34.25.17:27015 - XMAS MOD
89.34.25.38:27015 - XMAS MOD
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Facebook [Bot] and 12 guests