Witam. pr?bowa?em napisa? skrypt, w kt?rym po awansie postaci na ka?dy kolejny lvl wida? jaki? wy?wietlany "efekt" oraz po awansie na 20 lvl dostajemy kas?. Nie mniej jednak pr?ba zosta?a zako?czona niepowodzeniem - skrypt nie dzia?a je?li kto? widzi jaki? b??d w kodzie prosz? o porady:
<event type="advance" name="Getmoney" event="script" value="getmoney.lua"/>
<event type="advance" name="Getmoney" event="script" value="getmoney.lua"/>
Code:
local config =
{
levelReach = 20,
item = 2160,
count = 20
}
function onAdvance(cid, oldlevel, newlevel)
registerCreatureEvent(getPlayerPosition(cid), "Getmoney")
if(skill == SKILL__LEVEL and newLevel >= config.levelReach and getPlayerStorageValue(cid, 58557) == -1) then
setPlayerStorageValue(cid, 58557, 1)
doPlayerAddItem(cid, config.item, config.count)
end
return TRUE
end