CLICK HERE TO CHECK OUT MY KITTEN PHOTO GALLERY!!! NO IM NOT GAY LOL CATS ARE JUST AWESOME
Click spoiler - Don't be scared?
This is just a simple little system i threw together to spice up the rebirth/prestige system. Ill try to explain it as much as i can but bare with me.
Click to view - Ingame prestige shop scripts.
Click spoiler - Don't be scared?
This is just a simple little system i threw together to spice up the rebirth/prestige system. Ill try to explain it as much as i can but bare with me.
Click to view - Ingame prestige shop scripts.
Ok first add this to Data/Lib/050-function.lua anywhere at the bottom should be fine.
2. Now your going to want to add the mysql query so you have the points stored in mysql.
3. Now you can add this script to Data/Actions/TestLever.lua "Name it what ever you want idc".
(This is just a simple one that takes 1 Prestige Point and add's 1 premium day to the player.)
(You dont need this but i use it to give players 1 prestige point. add this to action scripts aswell)
If you want to make quests to give prestige points or a prestige npc just add this into the npc or script you wanna put it into.
Code:
-- Prestige Points --
function getPlayerPrestigeP(cid)
local Info = db.getResult("SELECT `Prestige Points` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local presp= Info:getDataInt("Prestige Points")
Info:free()
return presp
end
return LUA_ERROR
end
function doAddPrestigeP(cid, presp)
db.executeQuery("UPDATE `players` SET `Prestige Points` = `Prestige Points` + " .. presp .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
function doRemovePrestigep(cid, presp)
db.executeQuery("UPDATE `players` SET `Prestige Points` = `Prestige Points` - " .. presp .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
Code:
ALTER TABLE `players` ADD `Prestige Points` INT NOT NULL DEFAULT 0;
(This is just a simple one that takes 1 Prestige Point and add's 1 premium day to the player.)
Code:
local pp = 1
local cancelmsg = "You need "..pp.." prestige points."
local buymsg = "Congratulations! You have recieved 1 day of premium for "..pp.." Prestige point."
local Message = "You need "..pp.." coins to buy this item."
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPrestigeP(cid) < pp then
doPlayerSendTextMessage(cid,19,cancelmsg)
elseif getPlayerPrestigeP (cid) >= pp then
doCreatureSay(cid, buymsg, TALKTYPE_ORANGE_1)
doRemovePrestigep(cid, pp)
doPlayerAddPremiumDays(cid, 1)
else
doPlayerSendTextMessage(cid,19,Message)
end
return true
end
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerFreeCap(cid) >= 65 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You added +1 prestige point to your player.")
doAddPrestigeP(cid, 1)
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You just cant use this.")
end
return true
end
If you want to make quests to give prestige points or a prestige npc just add this into the npc or script you wanna put it into.
Code:
doAddPrestigeP(cid, #amount of points)
Last edited: