zerghel
Tsuni
- Joined
- Jul 1, 2008
- Messages
- 299
- Reaction score
- 9
hello otlanders, i had this talkaction working on our server, but i moved to tfs 1.1 and the talkaction is working no more, i'm not a scripter myself as many of you are, so i beg a little help rewriting it for tfs 1.1.
this talkaction gives points in exchange of crystal coins, so the players can buy items in the website and it works fine in tfs 0.2.15
(i think i posted this on a wrong section before(sorry for that))
this talkaction gives points in exchange of crystal coins, so the players can buy items in the website and it works fine in tfs 0.2.15
(i think i posted this on a wrong section before(sorry for that))
Code:
dofile('./config.lua')
function addPoints(playerName, amount)
local accNum = getAccountNumberByPlayerName(playerName)
if accNum == 0 or amount == 0 then
return
end
local env = assert(luasql.mysql())
local con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
assert(con:execute('UPDATE `znote_accounts` SET `points` = `points` + ' .. amount .. ' WHERE `account_id` = ' .. accNum .. ' LIMIT 1;'))
con:close()
env:close()
end
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 100000) then
addPoints(getCreatureName(cid), 10)
doCreatureSay(cid, 'You have received 10 premium points!', TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid, "You don't have enough money, 10 premium point costs 10 crystal coins.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
Last edited: