Модуль:Entity Lookup: различия между версиями

Нет описания правки
умоляю не сломайся
Строка 6: Строка 6:


-- p,getname{args={"FreedomImplant"}}
-- p,getname{args={"FreedomImplant"}}
function p.getname(frame) -- {{#invoke:Entity Lookup|getname|ProtoID}}
function p.getname(frame, entid) -- {{#invoke:Entity Lookup|getname|ProtoID}}
     local out = ""
     local out = ""
     local entity = p.entities[frame.args[1]]
     local id = ""
    if frame.args[1] ~= nil then id = frame.args[1]  
    else id = entid end
    local entity = p.entities[id]
     if entity ~= nil then
     if entity ~= nil then
         out = entity.name
         out = entity.name
Строка 19: Строка 22:


-- p,getname{args={"FreedomImplant"}}
-- p,getname{args={"FreedomImplant"}}
function p.getdesc(frame) -- {{#invoke:Entity Lookup|getdesc|ProtoID}}
function p.getdesc(frame, entid) -- {{#invoke:Entity Lookup|getdesc|ProtoID}}
     local out = ""
     local out = ""
     local entity = p.entities[frame.args[1]]
     local id = ""
    if frame.args[1] ~= nil then id = frame.args[1]  
    else id = entid end
    local entity = p.entities[id]
     if entity ~= nil then
     if entity ~= nil then
         out = entity.desc
         out = entity.desc