Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. @Tomarasdaf kk tenta trocar esse 10000 que coloquei e coloca so uns 500 pra ver, não conheço mto a função sacas? local add = 10000 -- 10 segundos tenta colocar por exemplo local add = 500 -- ou tenta colocar local add = 50 -- e vai testando
  2. @Tomarasdaf ja arrumei, ali no globalevents o interval é na tag, eu coloquei 5 de interval na tag e a cada 5 segundos vai subir 500(meio segundo) a cada 1000 = 1 segundo você pode colocar ali por exemplo 10 segundos de stamina a cada 5 segundos function onThink(pid, interval, lastExecution, thinkInterval) local refuel = 42 * 60 * 1000 -- full local add = 10000 -- 10 segundos for _, pid in ipairs(getPlayersOnline()) do if getTilePzInfo(getCreaturePosition(pid)) and getPlayerStamina(pid) < refuel then doPlayerSetStamina(pid, getPlayerStamina(pid) + add) end end return true end
  3. function onCastSpell(cid, var) local jogadorpos = getCreaturePosition(cid) local target = getCreatureTarget(cid) local monsterpos = getCreaturePosition(target) if target and isPlayer(target) then doTeleportThing(cid,monsterpos) doTeleportThing(target,jogadorpos) doSendMagicEffect(jogadorpos, 65) doSendMagicEffect(monsterpos, 65) else doPlayerSendTextMessage(cid,20,'It is not possible to use on creatures.') end return true end
  4. sera que fazendo pelo onThink nao é melhor? exemplo no creaturescript: staminareco.lua local storage = 323274 local store,exausted = 156892,30 function onLogin(cid) registerCreatureEvent(cid, "StaminaThink") setPlayerStorageValue(cid, store,0) setPlayerStorageValue(cid, storage, 0) return true end function onThink(cid, interval) if not isPlayer(cid) or not isCreature(cid) then return true end if getTilePzInfo(getCreaturePosition(cid)) and getPlayerStorageValue(cid, storage) <= 0 then setPlayerStorageValue(cid, storage, 1) if getPlayerStorageValue(cid, store) - os.time() <= 0 then doPlayerSendTextMessage(cid, 20, "{Stamina Recovery} Sua stamina começou a se recuperar, o fator de recuperação é de 30 segundos de stamina a cada 5 segundos dentro da zona de proteção em relação as condições normais.") setPlayerStorageValue(cid, store, os.time()+exausted) end elseif not getTilePzInfo(getCreaturePosition(cid)) and getPlayerStorageValue(cid, storage) > 0 then setPlayerStorageValue(cid, storage, 0) end return true end TAG <event type="login" name="StaminareLogin" event="script" value="staminareco.lua"/> <event type="think" name="StaminaThink" event="script" value="staminareco.lua"/> e no globalevents: staminareco.lua function onThink(pid, interval, lastExecution, thinkInterval) local refuel = 42 * 60 * 1000 -- full local add = 30000 -- 30 segundos for _, pid in ipairs(getPlayersOnline()) do if getTilePzInfo(getCreaturePosition(pid)) and getPlayerStamina(pid) < refuel then doPlayerSetStamina(pid, getPlayerStamina(pid) + add) end end return true end TAG <globalevent name="StaminaRegen" interval="5" script="staminareco.lua"/> obs: se o seu servidor for em milesegundos trocar o "5" por "5000"
  5. @BilauX function onSay(cid, words, param, channel) local split = param:explode(",") local name, count = split[1], tonumber(split[2]) local pid = getPlayerByNameWildcard(name) if (not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Player " .. param .. " is not currently online.") return TRUE end if not(split[2]) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The commands requires 2 parameters: character name, amount") end if not(count) then print(count) return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Numeric parameter required.") end doPlayerAddotfunPoints(pid, count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, count .. " otfun points were added to " .. name .. "\'s Account.") doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recived "..count.." otfun points!") return true end
  6. vc pode direcionar a pos do teleport dependendo do actionID do que piso onde ele passar, exemplo: AID 30501 --> POS 256,65,7 AID 30502 --> POS 587,72,5 etc...
  7. o que seria 0.5? 30 segundos de stamina?
  8. o certo é 'pid' e nao 'cid' doPlayerAddotfunPoints(pid, count)
  9. @Matheuus local min_group_id = 1 -- aqui vai contar a partir do 2, 3, 4 ... function onSay(cid, words, param, channel) local query, str = db.getResult("SELECT `name`, `group_id` FROM `players` WHERE `group_id` > "..min_group_id), "--> STAFF <--\n\n[Group]Nick | Status\n" if (query:getID() ~= -1) then repeat local _ = query:getDataString("name") local target_online = getPlayerByNameWildcard(_) if (not target_online or (isPlayerGhost(target_online) and getPlayerGhostAccess(target_online) > getPlayerGhostAccess(cid))) then status = "Offline" else status = "Online" end str = str .. "\n ["..getGroupInfo(query:getDataInt("group_id")).name.."]".._.." | "..status until not(query:next()) query:free() end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) return true end
  10. O certo seria refazer esse script feioso kkk mas to sem tempo local displayoutput = {"Resets","Level","Magic Level","Fist Fighting","Club Fighting","Sword Fighting","Axe Fighting","Distance Fighting","Shielding"} local itemtype = {9969,9933,5896,8929,8932,7388,8849,8906,2580} local storage = 378378 -- valor da storage function onSay(cid, words, param) number = 1 param = string.lower(param) skilllist = "" command = TRUE if param == "reset" then display = 1 elseif param == "level" then display = 2 elseif param == "magic" then id = 1 display = 3 elseif param == "club" then id = 2 display = 4 elseif param == "sword" then id = 3 display = 5 elseif param == "axe" then id = 4 display = 6 elseif param == "distance" then id = 5 display = 7 elseif param == "shield" then id = 6 display = 8 else error = 'Highscore Commands:\n\n!rank reset\n!rank level\n!rank magic\n!rank fist\n!rank club\n!rank sword\n!rank axe\n!rank distance\n!rank shield\n' doShowTextDialog(cid, 5958, error) command = FALSE end if command ~= FALSE then if display == 1 then local player = db.getResult("SELECT `name`, `reset` FROM `players` WHERE group_id < '2' ORDER BY `reset` DESC LIMIT 50;") if(player:getID() ~= -1) then while (true) do local name = player:getDataString("name") local level = player:getDataInt("reset") skilllist = skilllist.. "\n#"..string.format("%5s",number.." "..name.." - "..level) number = number + 1 if not(player:next()) then break end end player:free() end elseif display == 2 then local player = db.getResult("SELECT `name`, `level` FROM `players` WHERE group_id < '2' ORDER BY `level` DESC LIMIT 50;") if(player:getID() ~= -1) then while (true) do local name = player:getDataString("name") local level = player:getDataInt("level") skilllist = skilllist.. "\n#"..string.format("%5s",number.." "..name.." - "..level) number = number + 1 if not(player:next()) then break end end player:free() end elseif display == 3 then local player = db.getResult("SELECT `name`, `maglevel` FROM `players` WHERE group_id < '2' ORDER BY `maglevel` DESC LIMIT 50;") if(player:getID() ~= -1) then while (true) do local name = player:getDataString("name") local maglevel = player:getDataInt("maglevel") skilllist = skilllist.. "\n#"..string.format("%5s",number.." "..name.." - "..maglevel) if not(player:next()) then break end number = number + 1 end end player:free() else local skills = db.getResult("SELECT `player_id`, `value`, `skillid` FROM `player_skills` WHERE `skillid` = "..id.." ORDER BY `value` DESC;") while (true) do local GUID = skills:getDataInt("player_id") local value = skills:getDataInt("value") local skillid = skills:getDataInt("skillid") local player = db.getResult("SELECT `name` FROM `players` WHERE `id` = "..GUID.." and group_id < '2' ") if(player:getID() ~= -1) then local name = player:getDataString("name") skilllist = skilllist.. "\n#"..string.format("%5s",number.." "..name.." - "..value) number = number + 1 player:free() end if number > 50 then break end if not(skills:next()) then break end end skills:free() end dialog = ""..displayoutput[display].." Highscores: \n "..skilllist.."" doShowTextDialog(cid, itemtype[display], dialog) end end
  11. @Matheuus Primeiro me da a bunda e trato feito
  12. @Matheuus local min_group_id = 1 -- aqui vai contar a partir do 2, 3, 4 ... function onSay(cid, words, param, channel) local query, str = db.getResult("SELECT `name`, `group_id` FROM `players` WHERE `group_id` > "..min_group_id), "--> STAFF <--\n\n[Group]Nick | Status\n" if (query:getID() ~= -1) then repeat local _ = query:getDataString("name") local target_online = getPlayerByNameWildcard(_) str = str .. "\n ["..getGroupInfo(query:getDataInt("group_id")).name.."]".._.." | "..(isPlayerGhost(target_online) or not isPlayer(target_online) and "Offline" or "Online") until not(query:next()) query:free() end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) return true end
  13. qual a versão? 8.6 ou tfs 1.2+?
  14. posta o script que vc esta usando
  15. Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  16. Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  17. function onUse(cid,item,frompos,topos) local const = 3000 local itemid = 2197 local qtd = 5 local player = Player(cid) local freecap = player:getFreeCapacity() if player:getFreeCapacity() < (ItemType(itemid):getWeight(qtd) + ItemType(2003):getWeight()) then return player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have enough cap.') elseif not player:removeMoney(const) then return player:sendCancelMessage("You don't have enough money.") end local bp = doPlayerAddItem(cid, 2003, 1, false) for i = 1, 20 do doAddContainerItem(bp, itemid, qtd) end doPlayerSendTextMessage(cid,22,'It selling.') return true end
  18. @Storm Só uma correção, geralmente as funções 'get' 'set' começam com letras minusculas, por exemplo setGlobalStorageValue getGlobalStorageValue getTileThingByPos getTileInfo getPlayerStorageValue getPlayerLevel setPlayerStorageValue
  19. Você usa a versão mods? caso a resposta seja sim, troque para a versão de arquivos em LUA, o mesmo se encontra em anexo no tópico... Deve estar gerando conflito entre os arquivos.
  20. @victor4312 E o pior é que deve ter gente que compra! ?
  21. @Calidoress o erro é em outro script data/creaturescripts/scripts/advancesave.lua:onAdvance coloca esse script para eu dar uma olhada.
  22. @JuremaFox tenta colocar no final assim: if(split[1] == "sacar") then if((not tonumber(split[2]))) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas somente números são aceitos.") return true end local balance = db.storeQuery("SELECT `auction_balance` FROM `players` WHERE `id` = " .. player:getGuid()) local auction_balance = result.getDataInt(balance, "auction_balance") if (auction_balance < 1) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Você não possuí saldo suficiente para sacar.") result.free(balance) return true end local tz = auction_balance - split[2] player:sendTextMessage(MESSAGE_INFO_DESCR, "Você sacou " .. split[2] .. " gps de suas vendas no mercado! Seu saldo é de: "..tz.."gps.") player:addMoney(tz) db.query("UPDATE `players` SET `auction_balance` = ".. tz .." WHERE `id` = " .. player:getGuid() .. ";") result.free(balance) end
  23. function onDeath(cid, corpse, deathList) if getPlayerStamina(cid) >= 840 then setPlayerStamina(cid, getPlayerStamina(cid) - 840) doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) return true end return true end
  24. Não tem mapa, aquilo era um exemplo de como adicionar as posição no código.

Informação Importante

Confirmação de Termo