Witam,
Zrobiłem dzisiaj skill do PokeMod'a. Ma on działać na zasadzie pułapki. Gdy przeciwnik w nią wejdzie to wybucha i zadajeo brażenia + zamraża.
Wszystko działa jak trzeba, pułapka się podklada, jest wybuch ale... no własnie jest ale. Nie zdaje obrażen ani nic. Jak dałem indeks ID to zdawało obrażenia i zamrażało tego kto pułapkę postawił. Ale jeśli chodzi o przeciwnika to nic nie daje rady.
public Ice_Trap_Dmg(ent, id, skill, props)
{
if(!is_valid_ent(ent))
return;
//new level = ICE_TRAP_DAMAGE*SkillLevel(id, skill)
//new radius = ICE_TRAP_RADIUS + level
new attacker = entity_get_edict(ent, EV_ENT_owner);
if (get_user_team(attacker) != get_user_team(id))
{
new Float:fOrigin[3];
entity_get_vector( ent, EV_VEC_origin, fOrigin);
new iOrigin[3];
for(new i=0;i<3;i++)
iOrigin[i] = floatround(fOrigin[i]);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(SPRITE_INDEX[SPR_MUZZLEFLASH1]);
write_byte(32);
write_byte(20);
write_byte(0);
message_end();
new entlist[33];
new numfound = find_sphere_class(ent,"player", 90.0 ,entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid))
continue;
new damradius = ICE_TRAP_RADIUS;
new maxdamage = ICE_TRAP_DAMAGE;
new aid = pev(ent, pev_owner);
AddLvl(aid, maxdamage);
new Float:fl_vExplodeAt[3];
pev(attacker, pev_origin, fl_vExplodeAt);
new Float:attack_origin[3];
pev(id, pev_origin, attack_origin)
attack_origin[2] += 30;
skillAoEdamage(attacker, attack_origin, damradius, maxdamage, skill, AOE_IGNORE, _, STATUS_FROZEN, 10)
}
remove_entity(ent);
}
}