function onSay(player, param)
player:sendTextMessage(player:getExperience(), MESSAGE_INFO_DESCR) /player:getMaxMana()
return false
end
unexpected symbol near '/'Really? It's like a 4 line code.
Code:function onSay(player, param) player:sendTextMessage(player:getExperience(), MESSAGE_INFO_DESCR) /player:getMaxMana() return false end
Psudo code written on my phone so u'll have to look up the exact function names and param urself. Think u can handle that, sport?
If you actually read my post you'll see that i said that the code isn't proper, if you can't even google the solution you probably shouldn't open a server in the first place cuz it will probably die as soon as a bug is found.unexpected symbol near '/'
function onSay(player, words, param)
function onSay(cid, words, param)
local player = Player(cid)
If you actually read my post you'll see that i said that the code isn't proper, if you can't even google the solution you probably shouldn't open a server in the first place cuz it will probably die as soon as a bug is found.
Sure, i see your point. But can you honestly say that you're NOT tired if OTs opening up, earning a couple of bucks and close a week after?If you're going to help someone, the least you can do is not be a dick about it. If you don't have anything nice to say, say nothing at all.
function onSay(player, words, param)
function onSay(cid, words, param)
local player = Player(cid)
If you're using TFS 1.0 you may have to change the first line from
toCode:function onSay(player, words, param)
dont workCode:function onSay(cid, words, param) local player = Player(cid)
http://zapodaj.net/2fe96abf83269.png.html
Paste your full script here after you made the edits.
function onSay(cid, words, param)
local player = Player(cid)
local s = function(p, lv)
local k = Game.getExperienceStage(lv)
local st = p:getStamina()
if st > 2400 then
return k*1.5 .. " (stamina bonus)"
elseif st < 1 then
return 0 .. " (out of stamina)"
elseif st < 841 then
return k*0.5 .. " (stamina penalty)"
else
return k
end
end
if words == "!exp" then
local lv = p:getLevel()
p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You need " .. ((50 * lv^3) - (150 * lv^2) + (400 * lv)) / 3 - p:getExperience() .. " experience more, for " .. lv+1 .. " level.")
p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Current rate: x" .. s(p, lv))
return false
end
p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have to spend " .. math.ceil((p:getVocation():getRequiredManaSpent(p:getBaseMagicLevel() + 1) - p:getManaSpent()) / configManager.getNumber(configKeys.RATE_MAGIC)) .. " mana more, for next magic level.")
return false
end
PHP:function onSay(cid, words, param) local player = Player(cid) local s = function(p, lv) local k = Game.getExperienceStage(lv) local st = p:getStamina() if st > 2400 then return k*1.5 .. " (stamina bonus)" elseif st < 1 then return 0 .. " (out of stamina)" elseif st < 841 then return k*0.5 .. " (stamina penalty)" else return k end end if words == "!exp" then local lv = p:getLevel() p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You need " .. ((50 * lv^3) - (150 * lv^2) + (400 * lv)) / 3 - p:getExperience() .. " experience more, for " .. lv+1 .. " level.") p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Current rate: x" .. s(p, lv)) return false end p:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have to spend " .. math.ceil((p:getVocation():getRequiredManaSpent(p:getBaseMagicLevel() + 1) - p:getManaSpent()) / configManager.getNumber(configKeys.RATE_MAGIC)) .. " mana more, for next magic level.") return false end
thanks you workChange:
local player = Player(cid)
to
local p = Player(cid)