Sonical
Inactive
Version 1.
With this version you can get prem days only 1 time per account.
Another version below this!
In database run this command
Go to the data/lib/ and open functions.lua and add
In creaturescripts.xml add
In login.lua add
Premmylogg.lua
It worked, I tested it already 
Tested with 0.4
Version 2.
With this you can get 2 premium with one character. 1 char = 2 days, 2 char = 4 days etc.
Same login.lua and creaturescripts.xml as above, don't add that new column into your database! It isn't necessary with this script!
But edit
Premmylogg.lua
Tested with 0.4
REP++ Please :thumbup:
With this version you can get prem days only 1 time per account.
Another version below this!
In database run this command
PHP:
ALTER TABLE `accounts` ADD `premused` INT( 11 ) NOT NULL DEFAULT '0'
Code:
function getPlayerPremUsed(cid)
local Info = db.getResult("SELECT `premused` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("premused")
Info:free()
return days
end
return LUA_ERROR
end
Code:
<event type="login" name="Premmy" event="script" value="Premmylogg.lua"/>
LUA:
registerCreatureEvent(cid, "Premmy")
LUA:
local config ={
days = 2 --Edit how many days
}
function onLogin(cid)
if getPlayerPremUsed(cid) == 0 then
db.executeQuery("UPDATE `accounts` SET `premdays` = `premdays` + ".. config.days .." WHERE id = " .. getPlayerAccountId(cid) .. ";")
db.executeQuery("UPDATE `accounts` SET `premused` = 1 WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
return TRUE
end
Tested with 0.4
Version 2.
With this you can get 2 premium with one character. 1 char = 2 days, 2 char = 4 days etc.
Same login.lua and creaturescripts.xml as above, don't add that new column into your database! It isn't necessary with this script!
But edit
Premmylogg.lua
LUA:
local config ={
days = 2 --Edit how many days
}
function onLogin(cid)
queststatus = getPlayerStorageValue(cid,1147)
if queststatus == -1 then
db.executeQuery("UPDATE `accounts` SET `premdays` = `premdays` + ".. config.days .." WHERE id = " .. getPlayerAccountId(cid) .. ";")
setPlayerStorageValue(cid,1147,1)
end
return TRUE
end
REP++ Please :thumbup:
Last edited: