Dodanie usuwania ciał
Night90
18.08.2011
Witam, chciałbym by ktoś do tego pluginu dodał również znikanie ciał gdy ktoś zginie po 35 sek
Tutaj kod:
Tutaj kod:
#include <amxmodx> #include <fakemeta> #define PLUGIN "RemoveWeapons" #define VERSION "1.0.1" #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")){ if(!equal(model, "models/w_backpack.mdl")) { remove_task(ent) set_task(35.0,"removeEnt",ent) dllfunc(DLLFunc_Think, ent); return FMRES_IGNORED } }else if(equal(szClass,"weapon_shield")){ remove_task(ent) set_task(35.0,"removeEnt",ent) return FMRES_IGNORED; } 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(r) 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 } public removeEnt(iEnt){ if(!pev_valid(iEnt)) return ; new szClass[64]; pev(iEnt, pev_classname,szClass, charsmax(szClass)); if(!equal(szClass,"weaponbox") && !equal(szClass,"weapon_shield")) return ; engfunc(EngFunc_RemoveEntity, iEnt); }
Skull3D 18.08.2011
Testuj
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "RemoveWeapons"
#define VERSION "1.0.1"
#define AUTHOR "R3X"
new gcvarDef,gcvarDrop, gcvarBody;
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");
gcvarBody=register_cvar("amx_body_delete","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")){
if(!equal(model, "models/w_backpack.mdl"))
{
remove_task(ent)
set_task(35.0,"removeEnt",ent)
dllfunc(DLLFunc_Think, ent);
return FMRES_IGNORED
}
}else if(equal(szClass,"weapon_shield")){
remove_task(ent)
set_task(35.0,"removeEnt",ent)
return FMRES_IGNORED;
}
else if(gcvarBody == 1){
set_task(35.0, "removeBody");
}
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
}
public removeEnt(iEnt){
if(!pev_valid(iEnt)) return ;
new szClass[64];
pev(iEnt, pev_classname,szClass, charsmax(szClass));
if(!equal(szClass,"weaponbox") && !equal(szClass,"weapon_shield")) return ;
engfunc(EngFunc_RemoveEntity, iEnt);
}
public removeBody(){
set_msg_block( get_user_msgid( "ClCorpse" ), BLOCK_SET );
}
R3X
19.08.2011
to jak długo ciała leżą na mapie zależy od ustawień klienta; po śmierci gracz staje się obserwatorem i jego ciało znika z mapy, ale dokładnie wtedy wszyscy dostają info ClCorpse i klient tworzy w tym miejscu imitację leżącą tam dokładnie cl_corpsestay sekund
jak chcesz usuwać ciała po 35s musisz wymusić u gracza cl_corpsestay 35.0, ale taki plugin byłby bardzo nie fajny to po pierwsze, a po drugie niezgodny z regulaminem naszego forum
jak chcesz usuwać ciała po 35s musisz wymusić u gracza cl_corpsestay 35.0, ale taki plugin byłby bardzo nie fajny to po pierwsze, a po drugie niezgodny z regulaminem naszego forum
Adminek AMXX.PL 19.08.2011
Wiadomość wygenerowana automatycznie
Ten temat został zamknięty przez moderatora.
Powód: "Więc temat do zamknięcia"
Jeśli się z tym nie zgadzasz, raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL
Ten temat został zamknięty przez moderatora.
Powód: "Więc temat do zamknięcia"
Jeśli się z tym nie zgadzasz, raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL