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
 

Dev! - zdjęcie

Dev!

Rejestracja: 07.06.2010
Aktualnie: Nieaktywny
Poza forum Ostatnio: 07.07.2012 16:14
-----

Moje tematy

Bron znika po wyrzuceniu

20.06.2010 14:09

Witam, mam mały problem z kompilacją tego pluginu, bo chcę żeby po wyrzuceniu broni znikała każda oprócz paki.
Prosiłbym o o podanie kodu, i ewentualnie gotowego sma i amxx

#include <amxmodx>
#include <fakemeta>

#define PLUGIN "RemoveWeapons"
#define VERSION "1.0"
#define AUTHOR "R3X"

new gcvarDef,gcvarDrop;

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_SetModel,"fwSetModel",1);

gcvarDrop=register_cvar("amx_remove_dropped","1");
gcvarDef=register_cvar("amx_remove_default","1");

register_event("HLTV", "eventRoundInit", "a", "1=0", "2=0");
}
public eventRoundInit(){
new bool:enabled=(get_pcvar_num(gcvarDef)==0)
new ent=-1;
do{
ent=engfunc(EngFunc_FindEntityByString, ent,"classname", "armoury_entity");
if(pev_valid ( ent )) {
set_pev(ent, pev_solid, enabled?SOLID_TRIGGER:SOLID_NOT);
fm_set_rendering(ent,kRenderFxNone, 0,0,0, kRenderTransTexture,enabled?255:0);
}
}
while(ent);
}
public fwSetModel(ent, model[]){
if(get_pcvar_num(gcvarDrop)==0) return FMRES_IGNORED;
new szClass[32];
pev(ent, pev_classname,szClass, 31);
if(equal(szClass,"weaponbox") && !is_ent_c4(ent)){
dllfunc(DLLFunc_Think, ent);
return FMRES_HANDLED;
}else if(equal(szClass,"weapon_shield")){
engfunc(EngFunc_RemoveEntity, ent);
return FMRES_HANDLED;
}
return FMRES_IGNORED;
}
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) {
new Float:RenderColor[3]
RenderColor[0] = float®
RenderColor[1] = float(g)
RenderColor[2] = float(B)

set_pev(entity, pev_renderfx, fx)
set_pev(entity, pev_rendercolor, RenderColor)
set_pev(entity, pev_rendermode, render)
set_pev(entity, pev_renderamt, float(amount))

return 1
}

stock is_ent_c4( ent )
{
if (!pev_valid(ent))
return 0

new model[64]
pev(ent, pev_model, model, 63)

if (contain(model, "backpack")!=-1 || contain(model, "c4")!=-1)
return 1

return 0
}