Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function on_game_start()
- RegisterScriptCallback("actor_on_item_use",pda_callback)
- end
- function pda_callback(item)
- if (item:section() == "itm_pda_common") then
- if (dynamic_news_manager and axr_main.config:r_value("mm_options","enable_dynamic_news",1)) then
- dynamic_news_manager.get_dynamic_news():BoughtItems(npc,seller,buy_sell_items)
- end
- end
- end
- function DynamicNewsManager:RequestLocation()
- local actor_pos = db.actor:position()
- for i,id in ipairs(db.OnlineStalkers) do
- local npc = db.storage[id] and db.storage[id].object
- -- If npc is the same community as the player and less than 30m away
- if npc:relation(db.actor) ~= game_object.enemy and actor_pos:distance_to_sqr(npc:position()) < 900) then -- 30 meters ie. 30^2
- local msg = "We're " .. dynamic_news_helper.GetPointDescription(npc) -- Location Description
- local Se = strformat("%s, %s",sender:character_name(),dynamic_news_helper.GetCommunityDescription(sender,6)) -- NPC description
- self:PushToChannel(npc:character_community(),{Mg=msg,Ic=npc:character_icon(),Snd="news",Se=Se,It="npc"})
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement