HeberPcL
[PowerOT.com.br]
How to fix code for working in 0.3.6_SVN
Error:

PHP:
local config = {
fragTime = getConfigInfo('timeToDecreaseFrags')
}
function onSay(cid, words, param, channel)
local fragstatus = getPlayerStorageValue(cid,3943)
local fragsPvP = getPlayerStorageValue(cid,3944)
local amount = getPlayerRedSkullTicks(cid)
local frags = math.floor((amount / config.fragTime) + 1)
local remainingTime = math.floor(amount - (config.fragTime * (frags - 1)))
local hours = math.floor(((remainingTime / 1000) / 60) / 60)
local minutes = math.floor(((remainingTime / 1000) / 60) - (hours * 60))
if(amount > 0 and config.fragTime > 0) then
if (fragstatus > 1) and (fragsPvP > 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Frags: " .. fragstatus .. "] [Arena PVP: " .. fragsPvP .. "]You have " .. frags .. " unjustified frag" .. (frags > 2 and "s" or "") .. ". The amount of unjustified frags will decrease after: " .. hours .. "h and " .. minutes .. "m.")
elseif (fragsPvP > 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Arena PVP: " .. fragsPvP .. "] You have " .. frags .. " unjustified frag" .. (frags > 2 and "s" or "") .. ". The amount of unjustified frags will decrease after: " .. hours .. "h and " .. minutes .. "m.")
elseif (fragstatus > 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Frags: " .. fragstatus .. "] You have " .. frags .. " unjustified frag" .. (frags > 2 and "s" or "") .. ". The amount of unjustified frags will decrease after: " .. hours .. "h and " .. minutes .. "m.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have " .. frags .. " unjustified frag" .. (frags > 2 and "s" or "") .. ". The amount of unjustified frags will decrease after: " .. hours .. "h and " .. minutes .. "m.")
end
end
return TRUE
end
Error:
PHP:
[Error - TalkAction Interface]
data/talkactions/scripts/tools/frags.lua:onSay
Description:
data/talkactions/scripts/tools/frags.lua:8: attempt to call global 'getP
layerRedSkullTicks' (a nil value)
stack traceback:
data/talkactions/scripts/tools/frags.lua:8: in function <data/ta
lkactions/scripts/tools/frags.lua:5>