Support Alguien tiene el Script para entregar tibia coins con comando: canary 13.21

M

maricopex

Invited
alguien tiene el script para entregar tibia coins via comando podria ser /coins "nombre","cantidad". gracias
 
Solution
hola, muchas gracias, probando, me da error y no funciona el comando!!!

View attachment 4958


JavaScript:
--- Comando: /tc Nombre, Cantidad


local printConsole = true

local tibiaCoin = TalkAction("/tc")

function tibiaCoin.onSay(player, words, param)
    --if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
        --return true
    end

    if param == "" then
        player:sendCancelMessage("Command param required.")
        return false
    end

    local split = param:split(",")
    local name = split[1]
    local quantity = tonumber(split[2])

    if not quantity or quantity <= 0 then
        player:sendCancelMessage("Invalid quantity.")
        return false
    end

    local target = Player(name)
    if...
A probar, con un print que muestra en consola los TC mandados, hecho con base de Database Znote, en caso que sea distinta hay que cambiar el nombre de la columna de la tabla donde se encuentran los Tibia Coins.
En este script estan en Accounts > Points, si lo tienen en otro sitio digamos: Accounts 'Premium_points', cambian points por premium_points, si esta en otra tabla que accounts, y es no sé canary_accounts, cambian account por canary_accounts y listo:

JavaScript:
--- Comando: /tc Nombre, Cantidad


local printConsole = true

local tibiaCoin = TalkAction("/tc")

function tibiaCoin.onSay(player, words, param)
    if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
        return true
    end

    if param == "" then
        player:sendCancelMessage("Command param required.")
        return false
    end

    local split = param:split(",")
    local name = split[1]
    local quantity = tonumber(split[2])

    if not quantity or quantity <= 0 then
        player:sendCancelMessage("Invalid quantity.")
        return false
    end

    local target = Player(name)
    if target then
        db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. quantity .. "' WHERE `id` = '" .. target:getAccountId() .. "';")
        target:sendTextMessage(MESSAGE_INFO_DESCR, "You received ".. quantity .." Tibia Coins from ".. player:getName() ..".")
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have successfully transferred ".. quantity .." Tibia Coins to ".. target:getName() ..".")
        if printConsole then
            Spdlog.info(string.format("[tibiaCoin.onSay] - Player: %s has transferred %d Tibia Coins to the player: %s",
                player:getName(), quantity, target:getName()))
        end
        return true
    else
        player:sendCancelMessage("Player not found.")
        return true
    end
    return false
end

tibiaCoin:separator(" ")
tibiaCoin:register()
 
hola, muchas gracias, probando, me da error y no funciona el comando!!!

1721305981891.png


JavaScript:
--- Comando: /tc Nombre, Cantidad


local printConsole = true

local tibiaCoin = TalkAction("/tc")

function tibiaCoin.onSay(player, words, param)
    --if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
        --return true
    end

    if param == "" then
        player:sendCancelMessage("Command param required.")
        return false
    end

    local split = param:split(",")
    local name = split[1]
    local quantity = tonumber(split[2])

    if not quantity or quantity <= 0 then
        player:sendCancelMessage("Invalid quantity.")
        return false
    end

    local target = Player(name)
    if target then
        db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. quantity .. "' WHERE `id` = '" .. target:getAccountId() .. "';")
        target:sendTextMessage(MESSAGE_INFO_DESCR, "You received ".. quantity .." Tibia Coins from ".. player:getName() ..".")
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have successfully transferred ".. quantity .." Tibia Coins to ".. target:getName() ..".")
        if printConsole then
            Spdlog.info(string.format("[tibiaCoin.onSay] - Player: %s has transferred %d Tibia Coins to the player: %s",
                player:getName(), quantity, target:getName()))
        end
        return true
    else
        player:sendCancelMessage("Player not found.")
        return true
    end
    return false
end

tibiaCoin:separator(" ")
tibiaCoin:groupType("normal")
tibiaCoin:register()
 
hola, muchas gracias, probando, me da error y no funciona el comando!!!

View attachment 4958


JavaScript:
--- Comando: /tc Nombre, Cantidad


local printConsole = true

local tibiaCoin = TalkAction("/tc")

function tibiaCoin.onSay(player, words, param)
    --if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
        --return true
    end

    if param == "" then
        player:sendCancelMessage("Command param required.")
        return false
    end

    local split = param:split(",")
    local name = split[1]
    local quantity = tonumber(split[2])

    if not quantity or quantity <= 0 then
        player:sendCancelMessage("Invalid quantity.")
        return false
    end

    local target = Player(name)
    if target then
        db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. quantity .. "' WHERE `id` = '" .. target:getAccountId() .. "';")
        target:sendTextMessage(MESSAGE_INFO_DESCR, "You received ".. quantity .." Tibia Coins from ".. player:getName() ..".")
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have successfully transferred ".. quantity .." Tibia Coins to ".. target:getName() ..".")
        if printConsole then
            Spdlog.info(string.format("[tibiaCoin.onSay] - Player: %s has transferred %d Tibia Coins to the player: %s",
                player:getName(), quantity, target:getName()))
        end
        return true
    else
        player:sendCancelMessage("Player not found.")
        return true
    end
    return false
end

tibiaCoin:separator(" ")
tibiaCoin:groupType("normal")
tibiaCoin:register()


Claro al principio de tu codigo pusiste -- en el if, y la segunda linea también --, entonces el end que esta abajo tiene que traer también el -- sino tienes el error del eof.

Aqui esta:
JavaScript:
local printConsole = true

local tibiaCoin = TalkAction("/tc")

function tibiaCoin.onSay(player, words, param)
    --if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
        --return true
    --end

    if param == "" then
        player:sendCancelMessage("Command param required.")
        return false
    end

    local split = param:split(",")
    local name = split[1]
    local quantity = tonumber(split[2])

    if not quantity or quantity <= 0 then
        player:sendCancelMessage("Invalid quantity.")
        return false
    end

    local target = Player(name)
    if target then
        db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. quantity .. "' WHERE `id` = '" .. target:getAccountId() .. "';")
        target:sendTextMessage(MESSAGE_INFO_DESCR, "You received ".. quantity .." Tibia Coins from ".. player:getName() ..".")
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have successfully transferred ".. quantity .." Tibia Coins to ".. target:getName() ..".")
        if printConsole then
            Spdlog.info(string.format("[tibiaCoin.onSay] - Player: %s has transferred %d Tibia Coins to the player: %s",
                player:getName(), quantity, target:getName()))
        end
        return true
    else
        player:sendCancelMessage("Player not found.")
        return true
    end
    return false
end

tibiaCoin:separator(" ")
tibiaCoin:groupType("normal")
tibiaCoin:register()
 
Solution

Tibia Server Lists

#1 FEATURED US Ultron OT 1,499 / 5,000Online EXPStages PROTO8.6 ENGINEUltron OT RANK PTS5.9 +100% VOTES0 #2 FEATURED US Nefera 180 / 0Online EXPx1 PROTO15.20 ENGINECrystal Server RANK PTS5.1 +100% VOTES0 #3 FEATURED ES Deixis 0 / 0Offline EXPStages PROTO1098 ENGINETFS RANK PTS3.7 +100% VOTES1 #4 FEATURED ES Maeli 8 / 150Online EXPx10 PROTO10.98 ENGINETFS 1.4.2 RANK PTS3.7 +100% VOTES0 #5 MX Marlboro War 42 / 300Online EXP999 PROTO8.6 ENGINETFS 0.3.7 RANK PTS5.5 -33% VOTES0 #6 BR Tibinha YurOts 18 / 150Online EXPStages PROTO7.4 ENGINEYurOTS 1.5 RANK PTS5.2 -14% VOTES0 #7 US Halera 2 / 0Online EXPStages PROTO10.98 ENGINETFS 1.4.2 RANK PTS4.9 -83% VOTES0 #8 BR Exordion Legacy 53 / 2,000Online EXPx2 PROTO7.72 ENGINEExordion RANK PTS4.9 +100% VOTES0 #9 PL Lubelski 4 / 1,000Online EXP200 PROTO7.6 ENGINELubelskiOTS 2.56.0 RANK PTS4.6 -15% VOTES0 #10 DE DBU Online 0 / 400Online EXP11 PROTO8.6 ENGINETFS 1.0 RANK PTS4.3 +100% VOTES0 #11 PL ReWar 0 / 2,000Online EXPcustom PROTO8.6 ENGINEOther RANK PTS4.3 0% VOTES0 #12 PL Velesta 0 / 1,000Offline EXP20 PROTO8.0 ENGINETFS 1.4.2 RANK PTS4.3 -99% VOTES0 #13 ES JustRL FreeTC 1530 19 / 250Online EXPx2 PROTO15.30 ENGINECrystal Server RANK PTS4.3 +100% VOTES0 #14 ES Farlia Global 2026 0 / 333Offline EXPx5 PROTO15.25 ENGINEFarliaServ 1.525 RANK PTS3.9 -22% VOTES0 #15 SE MortalisOT Custom 0 / 500Offline EXP100x -1.2x PROTO10.98 ENGINEMortalisOT V1 RANK PTS3.8 +100% VOTES0 #16 US Rommania 0 / 500Online EXPstages, x10 PROTO7.4 ENGINETFS 0.4 RANK PTS3.6 +100% VOTES0 #17 US BerethaOnline 2 / 2,000Online EXPStages PROTO10.98 ENGINETFS RANK PTS3.5 +100% VOTES0
Top