Witam,
Ot?? mam taki skrypcik - oczywi?cie nie mojego autorstwa - kt?ry powinien dawa? nagrody za dany level. Nagrody s? w punktach i CC. No oczywi?cie skrypt mi w og?le nie dzia?a mimo tego, ?e nie wywala ?adnego b??du w silniku.
Oto skrypt:
Oczywi?cie je?eli kto? ma inny skrypt i chcia?by si? nim podzieli? to bardzo prosz?
Z g?ry dzi?kuj?.
Ot?? mam taki skrypcik - oczywi?cie nie mojego autorstwa - kt?ry powinien dawa? nagrody za dany level. Nagrody s? w punktach i CC. No oczywi?cie skrypt mi w og?le nie dzia?a mimo tego, ?e nie wywala ?adnego b??du w silniku.
Oto skrypt:
Code:
function onAdvance(cid, type, oldlevel, newlevel)
local config = {
storage = 98960,
levels = {
[25] = {itemId = 2160, itemCount = 1, storageValue = 6, pp = 1},
[50] = {itemId = 2160, itemCount = 3, storageValue = 5, pp = 1},
[100] = {itemId = 2160, itemCount = 5, storageValue = 4, pp = 25},
[150] = {itemId = 2160, itemCount = 5, storageValue = 3, pp = 50},
[200] = {itemId = 2160, itemCount = 10, storageValue = 2, pp = 50},
[250] = {itemId = 2160, itemCount = 10, storageValue = 1, pp = 60}}}
local param = string.lower(param)
if isPlayer(cid)
then
if (oldlevel ~= newlevel and type == SKILL__LEVEL) then
if (newlevel == config.levels[param] and getPlayerStorageValue(cid, config.storage) < config.level[param].storageValue) then
doPlayerAddItem(cid, config.levels[param].itemId, config.levels[param].itemCount)
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+"..config.levels[param].pp.." WHERE `id` = "..getPlayerAccountId(cid)..";")
doPlayerSendTextMessage(cid, 21 ,'Congratulations! You have reached level ' ..newLevel.. '! You have received 5 Cristal Coins.')
setPlayerStorageValue(cid, config.storage, config.levels[param].storageValue)
end
end
end
return true
end
Oczywi?cie je?eli kto? ma inny skrypt i chcia?by si? nim podzieli? to bardzo prosz?
Z g?ry dzi?kuj?.