- Dołączył
- Grudzień 18, 2008
- Posty
- 1196
- Liczba reakcji
- 97
Witam ostatnio szuka?em npc Og?oszenie i natkn??em si? na du?o temat?w w kt?rych forumowicze szukaj? takowego npc wiec postanowi?em go tutaj da?.
Npc nie jest m?j jest ?ci?gni?ty z silnika pod tibie 8.50
W data\npc Robimy Message.xml
Wklejamy to
Potem w data\npc\scripts Robimy Message.xml
I wklejamy to
Co ile sekund ma by? wy?wietlana wiadomo??
Tre?? wy?wietlanej wiadomo?ci
Npc nie jest m?j jest ?ci?gni?ty z silnika pod tibie 8.50
W data\npc Robimy Message.xml
Wklejamy to
<?xml version="1.0" encoding="UTF-8" ?>
- <npc name="Message" script="data/npc/scripts/message.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100" />
<look type="134" head="78" body="88" legs="0" feet="88" addons="3" />
</npc>
Potem w data\npc\scripts Robimy Message.xml
I wklejamy to
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
lastSay = 0
local message = "Przypominamy iz na stronie www istnieje reklama dzieki ktorej mozesz pom?c naszemu Ots WYSTARCZY TYLKO ZE NA NIA KLIKNIESZ - Zapraszamy!"
local typ = MESSAGE_STATUS_WARNING
local coIleSekund = 900
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.time() >= lastSay) then
lastSay = os.time()+coIleSekund
local gracze = getOnlinePlayers()
for i, pid in ipairs(gracze) do
local aktualny = getPlayerByName(pid)
if (isPlayer(aktualny) == TRUE) then
doPlayerSendTextMessage(aktualny,typ,message)
else
print('Kreatura '.. pid ..' nie jest graczem, a powinna.')
end
end
end
end
Co ile sekund ma by? wy?wietlana wiadomo??
Tre?? wy?wietlanej wiadomo?ci

nie s?ysza?em o tym ale mo?e ten npc komu? si? przyda 
tylko nazwij je inaczej