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

Windows Auto reward when level 50 bug.

Elite Questbane

Sylphera.com
Joined
Mar 11, 2008
Messages
185
Reaction score
0
Location
Sweden
Hey, I've just opened my server and I've got lot complains over the auto-reward you should get when 50. The script should work so I don't know what the problem is.

Anyway here's the code:
Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
  if newlevel == 50 then
    doPlayerAddItem(cid, 2160, 5)
    doPlayerSendTextMessage(cid, 22, "Congratulations! You have been awarded 5 crystal coins.")
  end
  return TRUE
end
 
maybe u can try read your script -.-
function onAdvance(cid, skill, oldLevel, newLevel)
if(newLevel == 50 and skill == SKILL__LEVEL) then

or

function onAdvance(cid, skill, oldLevel, imblind)
if(imblind == 50 and skill == SKILL__LEVEL) then

both should work ;x
 
... (you're that dumb) ...
function onAdvance(cid, skill, oldLevel, newLevel)
function onAdvance(cid, skill, oldLevel, imblind)
imblind will be newLevel...(unless u had edited sources..but.. im wasting time anyway).
uint32_t CreatureEvent::executeAdvance(Player* player, skills_t skill, uint32_t oldLevel, uint32_t newLevel)
 
Maybe Test This One ?

creaturescript/scripts/levelreward.lua
function onAdvance(cid, skill, oldlevel, newlevel)
local config = {
levelReach = 60,
item = 2160,
count = 10
}
if(skill == SKILL__LEVEL and newlevel >= config.levelReach and getPlayerStorageValue(cid, 9899) ~= 1) then
setPlayerStorageValue(cid, 9899, 1)
doPlayerAddItem(cid, config.item, config.count)
end
return TRUE
end

Creaturescripts/Creaturescripts.xml
<event type="advance" name="LevelReward" script="levelreward.lua"/>

Tested On Tfs 0.3.5
 
Back
Top