Can you show what kind of premium point system you are using?
<event type="kill" name="Demons" event="script" value="killdemons.lua"/>
registerCreatureEvent(cid, "Demons")
local config = {
["demon"] = {amount = 200, storage = 19000}
}
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster then
return true
end
setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1)
if (getPlayerStorageValue(cid, monster.storage) +1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you got 4 extra premium days for killing "..(getPlayerStorageValue(cid, monster.storage)+1).." "..getCreatureName(target).."s.")
doPlayerAddPremiumDays(cid, 4)
setPlayerStorageValue(cid, monster.storage, -1)
end
return true
end
So you mean just premium days like you can also buy with the buypremium talkaction?
creaturescripts.xml
XML:<event type="kill" name="Demons" event="script" value="killdemons.lua"/>
Add this to login.lua
Lua:registerCreatureEvent(cid, "Demons")
killdemons.lua
Lua:function onKill(cid, target) local config = { ["demon"] = {amount = 200, storage = 19000} } local monster = config[getCreatureName(target):lower()] local days = 4 if(isPlayer(target)) or not monster then return true end if getPlayerStorageValue(cid, monster.storage) >= -1 then setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1) end if (getPlayerStorageValue(cid, monster.storage) +1) == monster.amount then doPlayerSendTextMessage(cid, 22, "Congratulations, you got "..days.." extra premium days for killing "..(getPlayerStorageValue(cid, monster.storage) +1).." "..getCreatureName(target).."s.") doPlayerAddPremiumDays(cid, days) setPlayerStorageValue(cid, monster.storage, -1) end return true end
So you mean just premium days like you can also buy with the buypremium talkaction?
creaturescripts.xml
XML:<event type="kill" name="Demons" event="script" value="killdemons.lua"/>
Add this to login.lua
Lua:registerCreatureEvent(cid, "Demons")
killdemons.lua
Lua:function onKill(cid, target) local config = { ["demon"] = {amount = 200, storage = 19000} } local monster = config[getCreatureName(target):lower()] local days = 4 if(isPlayer(target)) or not monster then return true end if getPlayerStorageValue(cid, monster.storage) >= -1 then setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1) end if (getPlayerStorageValue(cid, monster.storage) +1) == monster.amount then doPlayerSendTextMessage(cid, 22, "Congratulations, you got "..days.." extra premium days for killing "..(getPlayerStorageValue(cid, monster.storage) +1).." "..getCreatureName(target).."s.") doPlayerAddPremiumDays(cid, days) setPlayerStorageValue(cid, monster.storage, -1) end return true end
local config = {
["demon"] = {amount = 200, storage = 19000}
}
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if isPlayer(target) or not monster then
return true
end
local stor = getPlayerStorageValue(cid, monster.storage)
if (stor +1) < monster.amount then
setPlayerStorageValue(cid, monster.storage, stor + 1)
end
stor = getPlayerStorageValue(cid, monster.storage)
if (stor +1) == monster.amount then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you got a rune for killing "..(stor +1).." "..getCreatureName(target).."s.")
doPlayerAddItem(cid, 2282, 1)
setPlayerStorageValue(cid, monster.storage, stor + 1)
end
return true
end
Lua:local config = { ["demon"] = {amount = 200, storage = 19000} } local itemname = rune -- name of the item local itemid = 2282 -- id of the item function onKill(cid, target) local monster = config[getCreatureName(target):lower()] if(isPlayer(target)) or not monster then return true end if getPlayerStorageValue(cid, monster.storage) >= -1 and (getPlayerStorageValue(cid, monster.storage)+1) < monster.amount then setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1) end if (getPlayerStorageValue(cid, monster.storage) +1) == monster.amount then doPlayerSendTextMessage(cid, 22, "Congratulations, you got a "..itemname.." for killing "..(getPlayerStorageValue(cid, monster.storage) +1).." "..getCreatureName(target).."s.") doPlayerAddItem(cid, itemid, 1) setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) + 1) end return true end
Tani Dont Open Old ThreadsLimos we also can use this for frags?
Can u make for frags i mean 200 frags u get 30 points for example?