• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Potrzebna pomoc w funkcji

Kawunnia

New Member
Joined
Nov 15, 2018
Messages
23
Reaction score
2
Potrzebuje coś takiego ze jak użyje w bp to pokazuje ze dodało mi punkty do konta na pomarańczowo ale myk jest taki ze jak użyje to na ziemi to widać ze dodało ale w tym miejscu gdzie kliknąłem dołaczam gif'a
Gyazo (https://gyazo.com/08a9a3fb93d2e676f3fc0196e38082c2)
Skrypt
Code:
function Position.sendMessage(self, message, talktype)

local cfg = {
    points = 50,
    effect = MESSAGE_STATUS_CONSOLE_BLUE
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not isPlayer(cid) then
        return false
    end
local accountId = Player(cid):getAccountId()

    db.query("UPDATE `znote_accounts` SET `points` = `points` + 50 WHERE `account_id` = " .. accountId)
    doCreatureSay(cid, "You have received " .. cfg.points .. " premium points!", TALKTYPE_ORANGE_1, false, nil, toPosition)
    doSendMagicEffect(toPosition, cfg.effect)
    doRemoveItem(item.uid, 1)
    return true
end
 
Słuchaj poradziłem sobie tak z frag remover'a pożyczyłem kawałek funkcji
Code:
local cfg = {
    points = 50,
    effect = CONST_ME_GIFT_WRAPS
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    if not isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received 50 premium points")
    doRemoveItem(item.uid, 1)

        return true
    end
    local accountId = Player(cid):getAccountId()

    db.query("UPDATE `znote_accounts` SET `points` = `points` + 50 WHERE `account_id` = " .. accountId)
    doCreatureSay(cid, "You have received " .. cfg.points .. " premium points!", TALKTYPE_ORANGE_1, false, nil, toPosition)
    doSendMagicEffect(fromPosition, cfg.effect)
    doRemoveItem(item.uid, 1)
    return true
end
 
Back
Top