• 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!

Special Doll TFS 1.0 (Shop Points, Addon, Mount)

xx Kami xx

Retired.
Joined
Dec 29, 2012
Messages
509
Reaction score
20
Hello im trying to get this script to work when i try to use it i get this error

PaWgQFR.png


script
Code:
function onUse(cid, item)
    if doRemoveItem(item.uid) then
      doPlayerAddPremiumPoints(cid, 30)
         doPlayerAddMount(cid, 9)
              doPlayerAddOutfit(cid, 471, 3)
              doPlayerAddOutfit(cid, 472, 3)
      doSendMagicEffect(getCreaturePosition(cid), 28)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You gain 30 premium points, Blazebringer mount, and Entrepreneur addon!')
   end
return true
end
 
doPlayerAddPremiumPoints doesn't exist.

Add this to your lib functions.
Code:
function doPlayerAddPremiumPoints(cid, points)
   return db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + ".. points .." WHERE `account_id` = '" ..getPlayerAccountId(cid).. "';")
end

Updated script.
Code:
local points = 30

function onUse(cid, item)
    if doRemoveItem(item.uid) then
        doPlayerAddPremiumPoints(cid, points)
        doPlayerAddMount(cid, 9)
        doPlayerAddOutfit(cid, 471, 3)
        doPlayerAddOutfit(cid, 472, 3)
          doSendMagicEffect(getCreaturePosition(cid), 28)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You gain '.. points ..' premium points, Blazebringer mount, and Entrepreneur addon!')
       end
    return true
end
 
Last edited:
doPlayerAddPremiumPoints doesn't exist.

Add this to your lib functions.
Code:
function doPlayerAddPremiumPoints(cid, points)
   return db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + ".. points .." WHERE `account_id` = '" ..getPlayerAccountId(cid).. "';")
end

Updated script.
Code:
local points = 30

function onUse(cid, item)
    if doRemoveItem(item.uid) then
        doPlayerAddPremiumPoints(cid, points)
        doPlayerAddMount(cid, 9)
        doPlayerAddOutfit(cid, 471, 3)
        doPlayerAddOutfit(cid, 472, 3)
          doSendMagicEffect(getCreaturePosition(cid), 28)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You gain '.. points ..' premium points, Blazebringer mount, and Entrepreneur addon!')
       end
    return true
end
fixed thanks! =)
 
So i tried too edit this script too make it just give premium points....

I use tfs 1.1 though.. and i think i am missing doremoveitem and getplayeraccountid functions?

Can u help me too? ><'
 
So i tried too edit this script too make it just give premium points....

I use tfs 1.1 though.. and i think i am missing doremoveitem and getplayeraccountid functions?

Can u help me too? ><'
Add this to compat.lua
Code:
function getPlayerAccountId(cid) local p = Player(cid) return p ~= nil and p:getAccountId() or false end
 
I would done smth like this:

Code:
local config = {
    mountId = 9,
    points = 30,
    outfit = {
        female = 471,
        male = 472,
        addon = 2
    }
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    -- Lets check if the player has the outfit or own the addon already, then we stop the code from execute
    local looktype = player:getSex() == PLAYERSEX_FEMALE and config.outfit.female or config.outfit.male
    if not player:hasOutfit(looktype) or (player:hasOutfit(looktype, config.outfit.addon) or player:hasMount(config.mountId)) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You do not own this outfit or you have already this addon or this mount.")
        return true
    end

    player:addMount(config.mountId)
    player:addOutfitAddon(looktype, config.outfit.addon)
    player:getPosition():sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
    player:sendTextMessage(MESSAGE_EVENT_ORANGE, "You have gain ".. config.points .." premium points, Blazebringer mount and Entrepreneur addon!")
    db.executeQuery("UPDATE `znote_accounts` SET `points` = `points` + ".. config.points .." WHERE `account_id` = '".. player:getAccountId() .."';")
    item:remove(1)
    return true
end
 
Last edited:
Oh boy the script is not adding points too the account for some reason :s
the animation works, but the doll does not vanish! :p
Im using gesior acc and i just changed 'znote_accounts' too 'accounts',

EDIT - I added item:remove() at the bottom of the code
and the doll dissapears on use, like it should.. but still no points :(

anything else I missed?
 
Back
Top