Postado Julho 23, 2014 11 anos 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 Ot Design: https://discord.gg/VgtVRNmCD7
Postado Julho 23, 2014 11 anos 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 Julho 23, 2014 11 anos por sidneivascao (veja o histórico de edições)
Postado Julho 23, 2014 11 anos Qualquer nome, mas ele deve ser o mesmo da tag, exemplo: <talkaction words="!buyhouse" filter="word-spaced" event="script" value="buyhouse"/> Ot Design: https://discord.gg/VgtVRNmCD7
Postado Julho 23, 2014 11 anos Autor Qualquer nome, mas ele deve ser o mesmo da tag, exemplo: <talkaction words="!buyhouse" filter="word-spaced" event="script" value="buyhouse"/> fiz o primeiro !buyhouse o segundo seria qual?
Postado Julho 23, 2014 11 anos pode usar a mesma tag, mas use só um dos scripts, eu puis dois caso 1 não funcionar. Ot Design: https://discord.gg/VgtVRNmCD7
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.