Ir para conteúdo

Featured Replies

Postado

Peço perdão, joguei errado no google. 

function onSay(cid, words, param)

	local lookPos = getPlayerLookPos(cid)
	local LEVEL = getConfigInfo("levelToBuyHouse")
	local house = House.getHouseByPos(lookPos)
	if(house == nil) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be looking to a house to buy one.")
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, words)
		return FALSE
	end

	if(house:buy(cid)) then
		doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
	else
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	end

	if(getPlayerLevel(cid) < LEVEL) then
		doPlayerSendCancel(cid, "You need level "..LEVEL.." to buy a house.")
		return TRUE
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, words)
	return FALSE
end


 local config = {
    teleportAccess = 3
}

function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return true
    end

    local teleport = false
    local t = string.explode(param, ",")
    if(t[2]) then
        teleport = getBooleanFromString(t[2])
        param = t[1]
    end

    local house = getHouseByPlayerGUID(getPlayerGUIDByName(param))
    if(not house) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " does not own house or doesn't exists.")
        return true
    end

    local houseInfo = getHouseInfo(house)
    if(teleport and getPlayerAccess(cid) >= config.teleportAccess) then
        doTeleportThing(cid, houseInfo.entry)
    end

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " owns house: " .. houseInfo.name .. ".")
    return true
end 

Testa um desses em data/talkactions/scripts

 

Depois adicione a tag em data/talkactions/talkactions.xml

  • Respostas 10
  • Visualizações 804
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor

Peço perdão, joguei errado no google. 

function onSay(cid, words, param)

	local lookPos = getPlayerLookPos(cid)
	local LEVEL = getConfigInfo("levelToBuyHouse")
	local house = House.getHouseByPos(lookPos)
	if(house == nil) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be looking to a house to buy one.")
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, words)
		return FALSE
	end

	if(house:buy(cid)) then
		doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
	else
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	end

	if(getPlayerLevel(cid) < LEVEL) then
		doPlayerSendCancel(cid, "You need level "..LEVEL.." to buy a house.")
		return TRUE
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, words)
	return FALSE
end


 local config = {
    teleportAccess = 3
}

function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return true
    end

    local teleport = false
    local t = string.explode(param, ",")
    if(t[2]) then
        teleport = getBooleanFromString(t[2])
        param = t[1]
    end

    local house = getHouseByPlayerGUID(getPlayerGUIDByName(param))
    if(not house) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " does not own house or doesn't exists.")
        return true
    end

    local houseInfo = getHouseInfo(house)
    if(teleport and getPlayerAccess(cid) >= config.teleportAccess) then
        doTeleportThing(cid, houseInfo.entry)
    end

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " owns house: " .. houseInfo.name .. ".")
    return true
end 

Testa um desses em data/talkactions/scripts

 

Depois adicione a tag em data/talkactions/talkactions.xml

qual nome crio no talkaction? e no xml?

Editado por sidneivascao (veja o histórico de edições)

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.1k

Informação Importante

Confirmação de Termo