Fala galera , faz tempo que não venho aqui
estou postando pq vi uns frango vendendo o código idêntico ao meu
Antes de começar já aviso que e necessário ter opcodes instalados na source do server
Vamos la
Em Creaturescript crie um arquivo chamado lookhouse.lua e cole isso lá
function stringValue(preco) if preco < 100 then return tostring(preco) else return tostring(string.format("%1.01f", value/100)) end return 'none' end function onLook(cid, thing, position, lookDistance) if not isCreature(thing.uid) then local house = getHouseFromPos(position) if house then local str = "Casa: "..getHouseName(house)..".\n" if getHouseOwner(house) ~= 0 then str = str.."Propietário: "..getPlayerNameByGUID( getHouseOwner(house) ).."\nPreço: "..getHousePrice(house).." dólares" else str = str.."Propietário: Não tem\nPreço: "..getHousePrice(house).." dólares" end if thing.itemid == 1252 or thing.itemid == 1249 or thing.itemid == 1251 or thing.itemid == 1254 or thing.itemid == 1250 or thing.itemid == 1212 or thing.itemid == 1214 or thing.itemid == 6891 or thing.itemid == 6893 or thing.itemid == 6900 or thing.itemid == 6902 or thing.itemid == 6892 or thing.itemid == 1213 or thing.itemid == 1219 or thing.itemid == 1220 or thing.itemid == 1222 or thing.itemid == 1221 or thing.itemid == 5515 or thing.itemid == 5516 or thing.itemid == 5517 or thing.itemid == 5518 or thing.itemid == 5119 or thing.itemid == 5120 or thing.itemid == 5128 or thing.itemid == 5129 or thing.itemid == 5098 or thing.itemid == 5100 or thing.itemid == 5107 or thing.itemid == 5109 then if getHouseOwner(house) ~= 0 then doSendPlayerExtendedOpcode(cid, 78, getHouseName(house).."@"..getPlayerNameByGUID( getHouseOwner(house) ).."@"..getHousePrice(house).."@"..getHouseInfo(house).beds/2) else doSendPlayerExtendedOpcode(cid, 78, getHouseName(house).."@Não a Propietário@"..stringValue(getHousePrice(house)).."@"..getHouseInfo(house).beds/2) end end return false end end return true end
em login.lua registre o evento
registerCreatureEvent(cid, "LookHouse")
em creaturescript.xml coloque a tag
<event type="look" name="Lookhouse" event="script" value="lookhouse.lua"/>
Modules do OTC
Não esqueça de registrar o modulo no interface.otmod
- game_house
E isso bom proveito
Créditos a mim por te feito o código e o modulo
Como vai ficar