tak jak w temacie
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.
|
Guest Message by DevFuse
szukam plugina na wyrzucanie granata na koniec rundy lub zabieranie
Temat rozp. tytusek, 24.05.2015 23:11
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
1 odpowiedź w tym temacie
#1
Napisano 24.05.2015 23:11
#2
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;
}
Użytkownicy przeglądający ten temat: 1
0 użytkowników, 1 gości, 0 anonimowych


Dodatki SourceMod












