Try this:
Level 20:
function onAdvance(cid, skill, oldlevel, newlevel)
if(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41024) ~= 1 and newlevel >= 20) then
setPlayerStorageValue(cid, 41024, 1)
doPlayerAddItem(cid, 3035, 30)
doCreatureSay(cid, "Congratulations " ...