Witam. Mam problem. Próbuję przerobić działko z coda tak, aby po postawieniu bazy (tego trójnogu) po 5 sek. stawiała tam się ta strzelająca puszka. Problem w tym, że nie wiem jak pobrać ID trójnogu w momencie tworzenia puszki aby powstałą tam gdzie trzeba.
Co trzeba wysłać do tej funkcji i jak to pobrać aby wykonała się jak trzeba:
public stawdzialo2(ent) { new Float:origin[3]; pev(ent,pev_origin,origin); new sentry_shot2 = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"func_breakable")) if (!sentry_shot2) { return 0 } new hp_dzialka hp_dzialka = get_pcvar_num(pcvarHealth) // hp_dzialka += dodatkowe_hp[pev(ent,pev_iuser1)] new szHealth[16] num_to_str(hp_dzialka, szHealth, charsmax(szHealth)) // get_string(hp_dzialka, szHealth, charsmax(szHealth)) // get_pcvar_string(hp_dzialka,szHealth,charsmax(szHealth)) fm_set_kvd(sentry_shot2, "health", szHealth, "func_breakable") fm_set_kvd(sentry_shot2, "material", "6", "func_breakable") fm_DispatchSpawn(sentry_shot2) set_pev(sentry_shot2, pev_classname, "sentry_shot") engfunc(EngFunc_SetModel, sentry_shot2, "models/sentry2.mdl") engfunc(EngFunc_SetSize, sentry_shot2, {-16.0, -16.0, 0.0}, {16.0, 16.0, 20.0}) origin[2] += 25.0; engfunc(EngFunc_SetOrigin, sentry_shot2, origin) new Float:fAngle[3]; pev(pev(ent,pev_iuser1), pev_v_angle, fAngle) fAngle[0] = 0.0 fAngle[1] += 180.0 fAngle[2] = 0.0 set_pev(sentry_shot2, pev_angles, fAngle) set_pev(sentry_shot2, pev_solid, SOLID_BBOX) set_pev(sentry_shot2, pev_movetype, MOVETYPE_TOSS) set_pev(sentry_shot2, pev_iuser1, pev(ent,pev_iuser1)) set_pev(sentry_shot2, pev_iuser2, ent) set_pev( sentry_shot2, pev_sequence, 0 ); set_pev( sentry_shot2, pev_animtime, get_gametime() ); set_pev( sentry_shot2, pev_framerate, 1.0 ); set_pev(sentry_shot2, pev_nextthink, get_gametime() + SENTRY_THINK) return sentry_shot2; }