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

Premium Scroll tfs 1.3

Dorianek

Member
Joined
Nov 29, 2018
Messages
247
Reaction score
10
Location
Poland
The script works, but how to fix this error?

console error

C++:
Lua Script Error: [Action Interface]
data/actions/scripts/other/premium30dni.lua:onUse
luaDebugPrint(). Deprecated function.
stack traceback:
        [C]: in function 'debugPrint'
        data/lib/compat/compat.lua:406: in function 'doSendAnimatedText'
        data/actions/scripts/other/premium30dni.lua:11: in function <data/actions/scripts/other/premium30dni.lua:7>

Script
C++:
local this_script_is_awesome = true -- The choice is your if you want the script work then you leave it true

local otswe = {
prem_days = 30, -- Edit how many days
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if this_script_is_awesome == true then
if isPlayer(cid) then
doPlayerAddPremiumDays(cid, otswe.prem_days)
doSendAnimatedText(getCreaturePosition(cid), otswe.prem_days, TEXTCOLOR_RED)
doPlayerSendTextMessage(cid, 19, "Gratz you have obtained +30 premium days.")
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, 19, "The admin dont want to admit it -.-.")
end
end
end
 
Solution
Lua:
local thisScriptIsAwesome = true -- The choice is your if you want the script work then you leave it true

local otswe = {
    prem_days = 30, -- Edit how many days
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(thisScriptIsAwesome) then
        cid:addPremiumDays(otswe.prem_days)
        --doSendAnimatedText(getCreaturePosition(cid), otswe.prem_days, TEXTCOLOR_RED) --this function is disabled in 1.3
        cid:sendTextMessage(19, "Gratz you have obtained +30 premium days.")
        item:remove()
    end
end
The script works, but how to fix this error?

console error

C++:
Lua Script Error: [Action Interface]
data/actions/scripts/other/premium30dni.lua:onUse
luaDebugPrint(). Deprecated function.
stack traceback:
        [C]: in function 'debugPrint'
        data/lib/compat/compat.lua:406: in function 'doSendAnimatedText'
        data/actions/scripts/other/premium30dni.lua:11: in function <data/actions/scripts/other/premium30dni.lua:7>

Script
C++:
local this_script_is_awesome = true -- The choice is your if you want the script work then you leave it true

local otswe = {
prem_days = 30, -- Edit how many days
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if this_script_is_awesome == true then
if isPlayer(cid) then
doPlayerAddPremiumDays(cid, otswe.prem_days)
doSendAnimatedText(getCreaturePosition(cid), otswe.prem_days, TEXTCOLOR_RED)
doPlayerSendTextMessage(cid, 19, "Gratz you have obtained +30 premium days.")
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, 19, "The admin dont want to admit it -.-.")
end
end
end
Cuz you're using old functions like doSendAnimatedText
 
Lua:
local thisScriptIsAwesome = true -- The choice is your if you want the script work then you leave it true

local otswe = {
    prem_days = 30, -- Edit how many days
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(thisScriptIsAwesome) then
        cid:addPremiumDays(otswe.prem_days)
        --doSendAnimatedText(getCreaturePosition(cid), otswe.prem_days, TEXTCOLOR_RED) --this function is disabled in 1.3
        cid:sendTextMessage(19, "Gratz you have obtained +30 premium days.")
        item:remove()
    end
end
 
Solution
Back
Top