Ir para conteúdo

Featured Replies

Postado

Boa Tarde Pessoal

Estou a Procura de Um Script Usando X Item Da Total de X Points !

Tenho Sistema Points Aqui mais nao consigo Acha Nenhum

Nao é Premium Points e Points Normal !

 

 

function onSay(cid, words, param)
    if (words == "!points") then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voc? tem " .. getPoints(cid) .. " Points.")
    elseif (words == "!rankpoints") then
        local max_players, str = 20, ""
        str = "--[ RANK POINTS ]--\n\n"
        query = db.getResult("SELECT `name`, `points` FROM `players` WHERE `points` > -1 AND `id` > 6 AND `group_id` < 2 ORDER BY `points` DESC, `name` ASC;")
        if (query:getID() ~= -1) then k = 1 while true do
            str = str .. "\n " .. k .. ". " .. query:getDataString("name") .. " - [" .. query:getDataInt("points") .. "]"
            k = k + 1
            if not (query:next()) or k > max_players then break end
        end query:free()
        end
        if str ~= "" then doShowTextDialog(cid, 6500, str) end
    elseif (words == "/addpoints") then
        if getPlayerAccess(cid) == 5 then
            local t = string.explode(param, ",")
            if not t[1] or not t[2] then return TRUE, doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end
            local player = getPlayerByName(t[1])
            local points = tonumber(t[2]) or 1
            local pid = getPlayerByNameWildcard(t[1])
            if (not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
                db.executeQuery("UPDATE players SET `points` = `points` + " .. points .. " WHERE `name` = " .. db.escapeString(t[1]) .. ";")
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "voc? adicionou " .. points .. " Points do jogador " .. t[1])
                return true
            end
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "voc? adicionou " .. points .. " Points do jogador " .. t[1])
            doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados " .. points .. " Points no seu character.")
            addPoints(player, points)
            doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Voc? agora tem " .. getPoints(player) .. " Points.")
        end
    elseif (words == "/delpoints") then
        if getPlayerAccess(cid) == 5 then
            local t = string.explode(param, ",")
            if not t[1] or not t[2] then return TRUE, doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end
            local player = getPlayerByName(t[1])
            local points = tonumber(t[2]) or 1
            local pid = getPlayerByNameWildcard(t[1])
            if (not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
                db.executeQuery("UPDATE players SET `points` = `points` - " .. points .. " WHERE `name` = " .. db.escapeString(t[1]) .. ";")
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "voc? removeu " .. points .. " Points do jogador " .. t[1])
                return true
            end
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "voce removeu " .. points .. " Points do jogador " .. t[1])
            doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram removidos " .. points .. " Points do seu character.")
            removePoints(player, points)
            doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Voce agora tem " .. getPoints(player) .. " Points.")
        end
    elseif (words == "/setpoints") then
        if getPlayerAccess(cid) == 5 then
            local t = string.explode(param, ",")
            if not t[1] or not t[2] then return TRUE, doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end
            local player = getPlayerByName(t[1])
            local points = t[2]
            local pid = getPlayerByNameWildcard(t[1])
            if (not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
                return TRUE, doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.")
            end
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Agora o jogador " .. t[1] .. " tem " .. points .. " Points no seu character.")
            doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "agora voc? tem " .. points .. " Points do seu character.")
            setPoints(player, points)
        end
    end
    return TRUE
end

 

  • Respostas 34
  • Visualizações 2.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local ponto = 11395 -- n mude local storage = 15412 -- mude para outro function onUse(cid, item) if getPlayerStorageValue(cid, storage) >= 0 then return doPlayerBroadcastMessage(cid, "Voce ja r

  • @Rayo Tem algumas sessões no fórum que utiliza uns tutoriais, dá uma pesquisada. Tem um grupo no Discord focado em programação OT Server - Lua, aonde tem uma gama de materiais lá.  @ZikaLord Olá, col

  • function getPlayerPoints (cid) local res = db.getResult('select `points` from players where name = '..getCreatureName(cid)..'') if(res:getID() == 1) then return false end local ret = res:getDataInt("p

Posted Images

Postado

Não entendi.. no caso você quer modificar esse script para ele da x item por x pontos?

Contribuições:
 

=> Distribuições/Servidores

  1. [8.60] The Forgotten Server 1.3 (COMPILADO WIN x64)

 

=> Scripts/Códigos/Tutoriais

  1. Pokemon pescado aparece em volta do seu pokemon
  2. [Gesior]Dobrar pontos PagSeguro a partir de x valor doado

 

 Gostou de alguma contribuição? Rep +?

Postado
local ponto = 11395 -- n mude
local storage = 15412 -- mude para outro

function onUse(cid, item)
	if getPlayerStorageValue(cid, storage) >= 0 then
		return doPlayerBroadcastMessage(cid, "Voce ja recebeu.")
	end
 if ponto == ponto then -- n mude

    doPlayerRemoveItem(cid, 2179)
    doPlayerAddItem(cid, ponto, 1) --  não mexa
    doPlayerBroadcastMessage(cid, "Voce recebeu")
    setPlayerStorageValue(cid, storage, 1) -- não mexa
	end
end

@djteteh

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

O rei de seu proprio destino é aquele que luta pela gloria do amanhã!
Discord : ZoR#9373


 

Postado

@ZikaLord Tem algum local deste fórum ou outro , que explique bem o uso dessas variáveis "Storage"?

Contribuições:
 

=> Distribuições/Servidores

  1. [8.60] The Forgotten Server 1.3 (COMPILADO WIN x64)

 

=> Scripts/Códigos/Tutoriais

  1. Pokemon pescado aparece em volta do seu pokemon
  2. [Gesior]Dobrar pontos PagSeguro a partir de x valor doado

 

 Gostou de alguma contribuição? Rep +?

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo