Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 01/28/22 em todas áreas

  1. erro no script de castspell item

    What Member reagiu a Kyle Bellini por uma resposta no tópico

    1 ponto
    agora o seu primeiro if tem dois "end", só precisa de um
  2. erro no script de castspell item

    What Member reagiu a Kyle Bellini por uma resposta no tópico

    1 ponto
    você colocou duas onCastSpell(cid, var), e uma delas não está fechada (que é a primeira), pode deletar ela, e manter apenas a de baixo daí só copiar o que tem dentro da primeira onCastSpell e jogar pra baixo, onde está a segunda
  3. erro no script de castspell item

    What Member reagiu a Kyle Bellini por uma resposta no tópico

    1 ponto
    Precisa fazer a verificação se o jogador possui tal item, para isso, basta utilizar a função getPlayerItemCount(cid, itemid) function onGetFormulaValues(cid, level, maglevel) local levelTotal = level local min = (levelTotal * 4) / 5 + (maglevel * 25) / 2 local max = (levelTotal * 5) / 5 + (maglevel * 27) / 2 return -min, -max end local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, 33) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 46) setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local function onCastSpell1(parameters) if not isPlayer(parameters.cid) then return true end doCombat(parameters.cid, parameters.combat1, parameters.var) end local config = { requiredItem = {itemid = 2675, count = 1} -- Coloque o id do item necessário em: 'itemid = aqui', e a quantidade necessária do item em: 'count = aqui' } function onCastSpell(cid, var) local parameters = {cid = cid, var = var, combat1 = combat1} local itemName = getItemNameById(config.requiredItem.itemid) if getPlayerItemCount(cid, config.requiredItem.itemid) < config.requiredItem.count then if config.requiredItem.count == 1 then doPlayerSendCancel(cid, string.format("You need %d %s to use this spell.", config.requiredItem.count, itemName)) else doPlayerSendCancel(cid, string.format("You need %d %ss to use this spell.", config.requiredItem.count, itemName)) end return end for k = 1, 10 do addEvent(function() if isCreature(cid) then addEvent(onCastSpell1, 1, parameters) end end, 1 + ((k-1) * 300)) end return true end
  4. [0.3.6] Função doPlayerOpenChannel

    deza reagiu a MySticaL por uma resposta no tópico

    1 ponto
    EDITADO REMOVIDO A VERSÃO 0.4 QUE CONTIA! SE QUISER A VERSÃO 0.4 SÓ VER NO PERFIL DO ALEXY. Oi, vim trazer a função doPlayerOpenChannel para tfs 0.3.6 Essa função nada mais é que quando o player loga abre os chat selecionado no login.lua automaticamente Essa função é para 0.3.6 Versões testada: 8.54 Vamos ao código em LuaScript.cpp Procure: //getChannelUsers(channelId) lua_register(m_luaState, "getChannelUsers", LuaScriptInterface::luaGetChannelUsers); Adicione em baixo: //doPlayerOpenChannel(cid, channelId) lua_register(m_luaState, "doPlayerOpenChannel", LuaScriptInterface::luaDoPlayerOpenChannel); Continuando procure: int32_t LuaScriptInterface::internalGetPlayerInfo(lua_State* L, PlayerInfo_t info) Acima adicione: int32_t LuaScriptInterface::luaDoPlayerOpenChannel(lua_State* L) { //doPlayerOpenChannel(cid, channelId) uint32_t channelId = popNumber(L); uint32_t cid = popNumber(L); ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(cid); if(player) lua_pushnumber(L, g_game.playerOpenChannel(cid, channelId) ? true : false); else { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushnumber(L, false); } return 1; } Agora em LuaScript.h Procure por: static int32_t luaGetChannelUsers(lua_State* L); abaixo adicione: static int32_t luaDoPlayerOpenChannel(lua_State* L); Agora em data/creaturescripts/scripts/login.lua Antes do último return true Adicione: doPlayerOpenChannel(cid, 7) -- 7 é o número do channel para ver é em data/xml/channels.xml Rep não cai o dedo
  5. (Resolvido)Ajuda com tabela sql players_items

    vasco4 reagiu a Rusherzin por uma resposta no tópico

    1 ponto
    Abre teu SQLite pressione Alt + E e cole isso: CREATE TABLE IF NOT EXISTS `player_items` ( `player_id` int(11) NOT NULL DEFAULT '0', `pid` int(11) NOT NULL DEFAULT '0', `sid` int(11) NOT NULL DEFAULT '0', `itemtype` int(11) NOT NULL DEFAULT '0', `count` int(11) NOT NULL DEFAULT '0', `attributes` blob NOT NULL ); E pressione F9
Líderes está configurado para São Paulo/GMT-03:00

Informação Importante

Confirmação de Termo