Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
có 1 plugin dạng dạng thế (file đính kèm)@sontung0:
- Làm cách nào để tạo ra 1 Entity có khả năng copy bản sao của player nhỉ, dias làm mà nó copy không đúng, đứng copy thì ko sao, nhưng ngồi + bắn mà copy thì nó ko làm dc, và 1 số nữa.

. Xem cái kia chả hiểu 
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#define PLUGIN "Fake"
#define VERSION "1.0"
#define AUTHOR "Dias"
new const fake_img_class[] = "fake_image"
new const fake_img_model[] = "models/player/hero/hero.mdl"
new bool:can_see_ent[33]
new saw_ent[33]
new Float:last[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
//register_forward(FM_AddToFullPack, "fw_AddToFullPack", 1)
register_think(fake_img_class, "fw_FakeImgThink")
register_clcmd("say /buy", "cmd_buy")
}
public client_putinserver(id)
{
set_task(1.0, "make_entity", id)
}
public plugin_precache()
{
precache_model(fake_img_model)
}
public cmd_buy(id)
{
can_see_ent[id] = true
}
public make_entity(id)
{
static Float:Origin[3]
entity_get_vector(id, EV_VEC_origin, Origin)
new ent = create_entity("info_target")
entity_set_origin(ent, Origin)
entity_set_float(ent,EV_FL_takedamage,1.0)
entity_set_float(ent,EV_FL_health,100.0)
entity_set_string(ent,EV_SZ_classname, fake_img_class)
entity_set_model(ent, fake_img_model)
entity_set_int(ent,EV_INT_solid, SOLID_NOT)
saw_ent[ent] = 1
entity_set_byte(ent,EV_BYTE_controller1,125)
entity_set_byte(ent,EV_BYTE_controller2,125)
entity_set_byte(ent,EV_BYTE_controller3,125)
entity_set_byte(ent,EV_BYTE_controller4,125)
new Float:maxs[3] = {16.0,16.0,36.0}
new Float:mins[3] = {-16.0,-16.0,-36.0}
entity_set_size(ent,mins,maxs)
entity_set_edict(ent, EV_ENT_owner, id)
entity_set_float(ent,EV_FL_animtime, 0.1)
entity_set_float(ent,EV_FL_framerate, 0.1)
entity_set_int(ent, EV_INT_sequence, 0)
entity_set_float(ent,EV_FL_nextthink, get_gametime() + 0.01)
drop_to_floor(ent)
return 1;
}
public fw_FakeImgThink(ent)
{
static id
id = pev(ent, pev_owner)
static Float:Origin[3]
static Float:Aim_Origin[3]
static sq
static controller[5]
static Float:Time
Time = get_gametime()
pev(id, pev_origin, Origin)
sq = pev(id, pev_sequence)
pev(id, pev_v_angle, Aim_Origin)
set_pev(ent, pev_origin, Origin)
set_pev(ent, pev_v_angle, Aim_Origin)
set_pev(ent, pev_sequence, sq)
pev(id, pev_controller, controller[0])
pev(id, pev_controller_0, controller[1])
pev(id, pev_controller_1, controller[2])
pev(id, pev_controller_2, controller[3])
pev(id, pev_controller_3, controller[4])
set_pev(ent, pev_controller, controller[0])
set_pev(ent, pev_controller_0, controller[1])
set_pev(ent, pev_controller_1, controller[2])
set_pev(ent, pev_controller_2, controller[3])
set_pev(ent, pev_controller_3, controller[4])
entity_set_float(ent,EV_FL_nextthink, get_gametime() + 0.01)
}
public fw_AddToFullPack(es_handled, inte, ent, host, hostflags, player, pSet)
{
if(!is_user_alive(player) || !is_user_connected(player))
return FMRES_IGNORED
static id
id = pev(ent, pev_owner)
if(!can_see_ent[host] || !saw_ent[ent])
{
set_es(es_handled, ES_Effects, get_es(es_handled, ES_Effects) | EF_NODRAW)
set_es(es_handled, ES_Solid, get_es(es_handled, ES_Solid) | SOLID_NOT)
}
return FMRES_HANDLED
}
Cần gì phải làm khổ thế này@sontung0:
- SỬa dùm dias này cái này đi. Xem cái kia chả hiểu
++ Sửa lại Func AddToFullPack
++ Sửa lại cái phần copy hành động của chủ nhân ở fw think
thế là dc :)
PHP:#include <amxmodx> #include <engine> #include <fakemeta> #include <hamsandwich> #include <fun> #define PLUGIN "Fake" #define VERSION "1.0" #define AUTHOR "Dias" new const fake_img_class[] = "fake_image" new const fake_img_model[] = "models/player/hero/hero.mdl" new bool:can_see_ent[33] new saw_ent[33] new Float:last[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) //register_forward(FM_AddToFullPack, "fw_AddToFullPack", 1) register_think(fake_img_class, "fw_FakeImgThink") register_clcmd("say /buy", "cmd_buy") } public client_putinserver(id) { set_task(1.0, "make_entity", id) } public plugin_precache() { precache_model(fake_img_model) } public cmd_buy(id) { can_see_ent[id] = true } public make_entity(id) { static Float:Origin[3] entity_get_vector(id, EV_VEC_origin, Origin) new ent = create_entity("info_target") entity_set_origin(ent, Origin) entity_set_float(ent,EV_FL_takedamage,1.0) entity_set_float(ent,EV_FL_health,100.0) entity_set_string(ent,EV_SZ_classname, fake_img_class) entity_set_model(ent, fake_img_model) entity_set_int(ent,EV_INT_solid, SOLID_NOT) saw_ent[ent] = 1 entity_set_byte(ent,EV_BYTE_controller1,125) entity_set_byte(ent,EV_BYTE_controller2,125) entity_set_byte(ent,EV_BYTE_controller3,125) entity_set_byte(ent,EV_BYTE_controller4,125) new Float:maxs[3] = {16.0,16.0,36.0} new Float:mins[3] = {-16.0,-16.0,-36.0} entity_set_size(ent,mins,maxs) entity_set_edict(ent, EV_ENT_owner, id) entity_set_float(ent,EV_FL_animtime, 0.1) entity_set_float(ent,EV_FL_framerate, 0.1) entity_set_int(ent, EV_INT_sequence, 0) entity_set_float(ent,EV_FL_nextthink, get_gametime() + 0.01) drop_to_floor(ent) return 1; } public fw_FakeImgThink(ent) { static id id = pev(ent, pev_owner) static Float:Origin[3] static Float:Aim_Origin[3] static sq static controller[5] static Float:Time Time = get_gametime() pev(id, pev_origin, Origin) sq = pev(id, pev_sequence) pev(id, pev_v_angle, Aim_Origin) set_pev(ent, pev_origin, Origin) set_pev(ent, pev_v_angle, Aim_Origin) set_pev(ent, pev_sequence, sq) pev(id, pev_controller, controller[0]) pev(id, pev_controller_0, controller[1]) pev(id, pev_controller_1, controller[2]) pev(id, pev_controller_2, controller[3]) pev(id, pev_controller_3, controller[4]) set_pev(ent, pev_controller, controller[0]) set_pev(ent, pev_controller_0, controller[1]) set_pev(ent, pev_controller_1, controller[2]) set_pev(ent, pev_controller_2, controller[3]) set_pev(ent, pev_controller_3, controller[4]) entity_set_float(ent,EV_FL_nextthink, get_gametime() + 0.01) } public fw_AddToFullPack(es_handled, inte, ent, host, hostflags, player, pSet) { if(!is_user_alive(player) || !is_user_connected(player)) return FMRES_IGNORED static id id = pev(ent, pev_owner) if(!can_see_ent[host] || !saw_ent[ent]) { set_es(es_handled, ES_Effects, get_es(es_handled, ES_Effects) | EF_NODRAW) set_es(es_handled, ES_Solid, get_es(es_handled, ES_Solid) | SOLID_NOT) } return FMRES_HANDLED }
có 1 cách để làm cho nó auto copy sequence của player mà
.Bác nào pro up cho anh em 1 biểu mẫu weapons SMA để làm wpn mới đi.
Lỗi này là sao?Help !L 10/14/2011 - 10:12:20: -------- Mapchange to de_torn --------
Host_Error: PF_precache_model_I: Model 'models/p_glock18.mdl' failed to precache because the item count is over the 512 limit.
Reduce the number of brush models and/or regular models in the map to correct thi


fw_AddToFullPack(es_handled, inte, ent, host, hostflags, player, pSet)
set_es(es_handled, ES_Effects, EF_NODRAW)
if (player) client_print(host, print_chat, "ent[%i] host[%i]", ent, host)
Nếu host là trong danh sách các victim bị dính bom thi kiểm tra các entVậy bây giờ phải check if như thế nào ?. Check 1 cái là có thể nhìn thấy cái fake ent, 1 cái là ẩn player cũ đi để hiện ent lên, rất rắc rối. nghĩ mãi vẫn chưa ra câu if

.hình như cậu vẫn chưa hiểu cái addtofullpack thì phảiNó ẩn ent đi rồi nó cũng ẩn luôn mấy cái client kia. Mình là host, giờ mình bị confuse thì mình cũng không thấy cái ent đâu, rồi bọn player team cũng bị ẩn luôn :(
. Mỗi tội là check nhiều nên rối loạn cả đầu
public fw_AddToFullPack(es_handled, inte, ent, host, hostflags, player, pSet)
{
if(!is_user_alive(host) || !is_user_connected(host))
return FMRES_IGNORED
if(is_confusing[host] && ent == saw_ent)
{
set_es(es_handled, ES_Effects, get_es(es_handled, ES_Effects) | EF_NODRAW)
}
return FMRES_HANDLED
}

// bien nay dung de luu attacker cua victim (g_iConfusing[vcitim] = attacker)
new g_iConfusing[33]
// bien nay dung de luu ent fake cua attacker (g_iEntFake[attacker] = ent fake
new g_iEntFake[33]
public fw_AddToFullPack(es_handled, inte, ent, host, hostflags, player, pSet)
{
// neu host ko con song thi bo qua
if ( !is_user_alive(host) )
return FMRES_IGNORED
// neu host ko bi dinh bomb hc thang attacker da chet
new iAttacker = g_iConfusing[host]
if ( !iAttacker || !is_user_alive(iAttacker) )
return FMRES_IGNORED
// neu ent chinh la thang dap bom
if (ent == iAttacker)
{
// xu ly thang do
set_es(es_handled, ES_Effects, EF_NODRAW)
}
// neu ent la fake player cua attack
else if (g_iEntFake[iAttacker] == ent)
{
// show hang cho thang host xem
}
return FMRES_HANDLED
}
k ai giúp àk :( bác sontung với dias thì cứ bàn cái j j ấyai cho xin cái plugin lúc mình có máu ~25HP thì nó hiện lên màn hình đỏ và ghi "you're hurt, get to cover", giống mw2 ý
![]()
