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,510 / 5,000 EXPStages PROTO8.6 ENGINEUltron OT RANK PTS6.6 -9% VOTES0 #2 FEATURED US Nefera 237 / 0 EXPx1 PROTO15.20 ENGINECrystal Server RANK PTS5.9 +24% VOTES0 #3 FEATURED CL ZHYRAVEX 16 / 500 EXPx5 PROTO10.98 ENGINETFS 1.4.2 RANK PTS4.8 +100% VOTES0 #4 FEATURED ES Deixis 0 / 0 EXPStages PROTO1098 ENGINETFS RANK PTS4.0 -60% VOTES1 #5 DE DBU Online 198 / 400 EXP11 PROTO8.6 ENGINETFS 1.0 RANK PTS6.1 +1,000% VOTES0 #6 BR Exordion Legacy 65 / 2,000 EXPx2 PROTO7.72 ENGINEExordion RANK PTS5.7 +2% VOTES0 #7 MX Marlboro War 41 / 300 EXP999 PROTO8.6 ENGINETFS 0.3.7 RANK PTS5.5 -27% VOTES0 #8 BR Tibinha YurOts 30 / 150 EXPStages PROTO7.4 ENGINEYurOTS 1.5 RANK PTS5.5 +5% VOTES0 #9 US Wiki Ots 58 / 1,000 EXPx9999 PROTOcustom client ENGINETFS 1.4.2 RANK PTS5.1 +100% VOTES0 #10 ES JustRL FreeTC 1530 23 / 250 EXPx2 PROTO15.30 ENGINECrystal Server RANK PTS5.0 +15% VOTES0 #11 PL Lubelski 2 / 1,000 EXP200 PROTO7.6 ENGINELubelskiOTS 2.56.0 RANK PTS4.9 -16% VOTES0 #12 PL ReWar 0 / 2,000 EXPcustom PROTO8.6 ENGINEOther RANK PTS4.6 +100% VOTES0 #13 US Halera 0 / 0 EXPStages PROTO10.98 ENGINETFS 1.4.2 RANK PTS4.4 -83% VOTES0 #14 BR Turion Server 0 / 2,000 EXPx1 PROTO7.4 ENGINETurion 7.7 Project RANK PTS4.4 +158% VOTES0 #15 PL Velesta 0 / 1,000 EXP20 PROTO8.0 ENGINETFS 1.4.2 RANK PTS4.4 -100% VOTES0 #16 US BerethaOnline 0 / 2,000 EXPStages PROTO15.0 ENGINETFS RANK PTS4.3 -72% VOTES0 #17 ES Farlia Global 2026 0 / 333 EXPx5 PROTO15.25 ENGINEFarliaServ 1.525 RANK PTS4.0 -100% VOTES0 #18 SE MortalisOT Custom 0 / 500 EXP100x -1.2x PROTO10.98 ENGINEMortalisOT V1 RANK PTS4.0 -100% VOTES0 #19 RU Oldavia | 8.60 0 / 0 EXPx9999 PROTO8.6 ENGINETFS 1.3 RANK PTS3.9 +100% VOTES0 #20 BR Rethoria OpenToday 7.4 Custom 7 / 0 EXPx10 PROTO10.98 ENGINEOther RANK PTS3.8 +100% VOTES0 #21 US Rommania 0 / 3,000 EXPstages, x10 PROTO7.4 ENGINETFS 0.4 RANK PTS3.7 -89% VOTES0 #22 MX Maeli 0 / 150 EXPx10 PROTO10.98 ENGINETFS 1.4.2 RANK PTS3.5 -36% VOTES0 #23 ES DarkDragon EXPx10 PROTO8.6 ENGINECanary RANK PTS0.0 0% VOTES0
Top