Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

szukam plugina na wyrzucanie granata na koniec rundy lub zabieranie


Najlepsza odpowiedź Asiap, 25.05.2015 00:20

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "asiap"

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);

	register_logevent("KoniecRundy", 2, "1=Round_End");
}

public KoniecRundy()
{
	new Players[32], iNum, iPlayer;
	get_players(Players, iNum, "ach");

	for(iPlayer = 0; iPlayer < iNum; ++iPlayer)
	{
		StripUserWeaponName(Players[iPlayer], "weapon_hegrenade");
	}
}

stock StripUserWeaponName(iPlayer, szWeapon[])
{
	new iWeapon = get_weaponid(szWeapon);
	if(!iWeapon)
	{
		return PLUGIN_CONTINUE;
	}

	new iEnt;
	while((iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", szWeapon)) && pev(iEnt, pev_owner) != iPlayer)
	{
	}

	if(!iEnt)
	{
		return PLUGIN_CONTINUE;
	}

	if(get_user_weapon(iPlayer) == iWeapon)
	{
		ExecuteHamB(Ham_Weapon_RetireWeapon, iEnt);
	}

	if(!ExecuteHamB(Ham_RemovePlayerItem, iPlayer, iEnt))
	{
		return PLUGIN_CONTINUE;
	}

	ExecuteHamB(Ham_Item_Kill, iEnt);
	set_pev(iPlayer, pev_weapons, pev(iPlayer, pev_weapons) & ~(1<<iWeapon));
	return PLUGIN_HANDLED;
}
Przejdź do postu


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
1 odpowiedź w tym temacie

#1 tytusek

    Czempion

  • Power User

Reputacja: 229
Wszechwidzący

  • Postów:822
Offline

Napisano 24.05.2015 23:11

tak jak w temacie 


  • +
  • -
  • 0

#2 Asiap

    Wszechpomocny

  • Girl

Reputacja: 171
Profesjonalista

  • Postów:323
  • Lokalizacja:Kętrzyn
Offline

Napisano 25.05.2015 00:20   Najlepsza odpowiedź

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "asiap"

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);

	register_logevent("KoniecRundy", 2, "1=Round_End");
}

public KoniecRundy()
{
	new Players[32], iNum, iPlayer;
	get_players(Players, iNum, "ach");

	for(iPlayer = 0; iPlayer < iNum; ++iPlayer)
	{
		StripUserWeaponName(Players[iPlayer], "weapon_hegrenade");
	}
}

stock StripUserWeaponName(iPlayer, szWeapon[])
{
	new iWeapon = get_weaponid(szWeapon);
	if(!iWeapon)
	{
		return PLUGIN_CONTINUE;
	}

	new iEnt;
	while((iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", szWeapon)) && pev(iEnt, pev_owner) != iPlayer)
	{
	}

	if(!iEnt)
	{
		return PLUGIN_CONTINUE;
	}

	if(get_user_weapon(iPlayer) == iWeapon)
	{
		ExecuteHamB(Ham_Weapon_RetireWeapon, iEnt);
	}

	if(!ExecuteHamB(Ham_RemovePlayerItem, iPlayer, iEnt))
	{
		return PLUGIN_CONTINUE;
	}

	ExecuteHamB(Ham_Item_Kill, iEnt);
	set_pev(iPlayer, pev_weapons, pev(iPlayer, pev_weapons) & ~(1<<iWeapon));
	return PLUGIN_HANDLED;
}

  • +
  • -
  • 1




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych