MA

House look otPokemon

Por Marshmello, 19 de ago. de 2022 em Tutoriais de Scripting

6
6.7k
MarshmelloM
19 de agosto de 2022 às 12:29

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

game_house.rar

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

Spoiler

768279868_unknown(1).png.7017ad9ff44207719bddf8a34d22f7b2.png

 

Editado Agosto 19 por Marshmello

23 de agosto de 2022 às 17:50

Da pra modificar e fazer uns módulos tipo placa de cidade

HirxzsxopH
25 de agosto de 2022 às 14:24

Extraordinario MarshMello, comunidade agradece e muito.

4 meses depois...
11 de dezembro de 2022 às 13:57

Poderia me add no Discord?

Gostaria de remunerar você por alguns trabalhos. GhostTMZ#5113

Editado Dezembro 11 por Barbie Favela

1 mês depois...
gusangtvG
12 de janeiro de 2023 às 22:44

Fiz tudo certo, minha base tem opcodes não tem nenhum erro na distro e ao dar look na house continua normal

3 meses depois...
rafersiqR
25 de abril de 2023 às 09:40
Em 12/01/2023 em 22:44, gusangtv disse:

Fiz tudo certo, minha base tem opcodes não tem nenhum erro na distro e ao dar look na house continua normal

da algum erro no terminal do client?

se der manda aki