josejunior23
read&read&read
Hi Otlanders,
i've made this for a friend...and i want to share for who need something like that....
If you don't want use "Item Shop" at website, then...this Talkactions as made for you!
YOU CAN USE THIS SCRIPTS WITH http://otland.net/f118/paypal-script-release-24188/
Execute with MYSQL:
You'll Need those function:
Data/Lib/Function.lua
it's a simple script, nothing really good.
Data/Talkactions/Talkactions.xml
Data/Talkactions/Scripts/Buy.Lua
How It Works
points: how much points will remove from ACCOUNT.
itemadd: ItemID that will be added to Player.
countadd: Count of item, ex: if you want to add 100x Crystal coin.
HOW BUY:
Ok, player type "!buy expscroll"
also
!buy vipscroll
!buy addonscroll
!buy expscroll
!buy ml scroll
!buy crystalcoin
then he'll got the item.
just change and make it how you want!
---
CREDITS:
Funcions: Nahruto and Pitufo™
Script: Me
i've made this for a friend...and i want to share for who need something like that....
If you don't want use "Item Shop" at website, then...this Talkactions as made for you!
YOU CAN USE THIS SCRIPTS WITH http://otland.net/f118/paypal-script-release-24188/
Execute with MYSQL:
Lua:
ALTER TABLE `accounts` ADD `premium_points` INT( 11 ) NOT NULL DEFAULT '0';
You'll Need those function:
Data/Lib/Function.lua
Lua:
function getAccountPoints(cid)
local Info = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local Points= Info:getDataInt("premium_points")
Info:free()
return Points
end
return LUA_ERROR
end
Lua:
function doRemovePoints(cid, points)
local dif = getAccountPoints(cid) - points
if dif >= 0 then
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
return TRUE
end
return FALSE
end
it's a simple script, nothing really good.
Data/Talkactions/Talkactions.xml
Lua:
<talkaction words="!buy" script="buy.lua"/>
Data/Talkactions/Scripts/Buy.Lua
Lua:
CONFIG = {
["vipscroll"] = {points = 3, itemadd = 7722, countadd = 1},
["addonscroll"] = {points = 2, itemadd = 7726, countadd = 1},
["expscroll"] = {points = 4, itemadd = 1951, countadd = 1},
["mlscroll"] = {points = 4,itemadd= 1953, countadd = 1},
["crystalcoin"] = {points = 2, itemadd = 2160, countadd = 100}
}
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return TRUE
end
local donor = CONFIG[string.lower(param)]
if doRemovePoints(cid, donor.points) == TRUE then
doPlayerAddItem(cid, donor.itemadd, donor.countadd)
doPlayerSendTextMessage(cid, TALKTYPE_BROADCAST, "Thank You for Donating! Here you got: x" .. donor.countadd .. " " .. getItemNameById(donor.itemadd) .. ", Have Fun!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BATS)
else
doPlayerSendTextMessage(cid, TALKTYPE_BROADCAST, "You don\'t have enough donor points! Please, visit our site for more information.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return TRUE
end
How It Works
points: how much points will remove from ACCOUNT.
itemadd: ItemID that will be added to Player.
countadd: Count of item, ex: if you want to add 100x Crystal coin.
HOW BUY:
Ok, player type "!buy expscroll"
also
!buy vipscroll
!buy addonscroll
!buy expscroll
!buy ml scroll
!buy crystalcoin
then he'll got the item.
just change and make it how you want!
---
CREDITS:
Funcions: Nahruto and Pitufo™
Script: Me
Last edited: