VU

[Resolvido] Script De House

Por vudi, 23 de abr. de 2012 em Scripts

script
4
1.2k
vudiV
23 de abril de 2012 às 17:00

Tipo queria uma scripter do player comprar uma casa , e se ele nao loga a mais de 25 dias ele perdia a house e os itens iria pro dp

 

alguem pode me ajudar?

 

Repp+

Makelin1M
23 de abril de 2012 às 18:01

olha tentei criar um desse tipo e nao consegui fazer entao achei um do jhon992 aki porem o script n e meu !! e outra coisa esse e se n logar 30 dias foi oq eu consigui achar

 

Vai em data/globalscripts/scripts/ duplica um arquivo e nomeia para "houseclean" sem as aspas e nele cole:

 

 

function onThink(interval, lastExecution, thinkInterval)

 

local b = 0

local d = db.getResult("SELECT `owner` FROM `houses` WHERE `owner` > "..b..";")

 

if (d:getDataInt("owner") ~= false) then

local c = db.getResult("SELECT `name` FROM `players` WHERE `id` == "..d:getDataInt("owner")..";")

local lastLogin = getPlayerLastLoginSaved(getPlayerByName(c:getDataString("name")))

local e = db.getResult("SELECT `id` FROM `houses` WHERE `owner` == "..d:getDataInt("owner")..";")

 

if (os.date("%d", lastLogin) <= os.date("%d") and os.date("%b", lastLogin) ~= os.date("%b")) then

doCleanHouse(e:getDataInt("id"))

setHouseOwner(e:getDataInt("id"), 0)

end

end

 

while (d:next() ~= false) do

c = db.getResult("SELECT `name` FROM `players` WHERE `group_id` == "..d:getDataInt("owner")..";")

lastLogin = getPlayerLastLoginSaved(getPlayerByName(c:getDataString("name")))

e = db.getResult("SELECT `id` FROM `houses` WHERE `owner` == "..d:getDataInt("owner")..";")

if (os.date("%d", lastLogin) <= os.date("%d") and os.date("%b", lastLogin) ~= os.date("%b")) then

doCleanHouse(e:getDataInt("id"))

setHouseOwner(e:getDataInt("id"), 0)

end

end

 

return true

end

 

Agora em globalevents.xml cole a tag:

 

<globalevent name="houseclean" interval="86400" event="script" value="houseclean.lua"/>

 

so isso se ajudei + rep

vudiV
24 de abril de 2012 às 02:43

Obrigado Rep+

VildenV
24 de abril de 2012 às 02:46

Dúvida sanada, tópico movido.