• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[request] Stacore help thread

nystrom

New Member
Joined
Nov 17, 2009
Messages
269
Reaction score
0
Well as we havent got a experienced scripter in our team i use this for my questions. I also going to write all answe in this post so other ones can use it.


First question solved

How to change/add sql value in .lua
http://otland.net/f163/doplayeraddpremiumpoints-79217/

I got error though.. While using this script:

Error
[03/06/2010 23:38:31] [Error - Action Interface]
[03/06/2010 23:38:31] data/actions/scripts/inquichest.lua:eek:nUse
[03/06/2010 23:38:31] Description:
[03/06/2010 23:38:31] data/lib/050-function.lua:664: attempt to call global 'getAccountId' (a nil value)
[03/06/2010 23:38:31] stack traceback:
[03/06/2010 23:38:31] data/lib/050-function.lua:664: in function 'doPlayerAddPvpPoints'
[03/06/2010 23:38:31] data/actions/scripts/inquichest.lua:12: in function <data/actions/scripts/inquichest.lua:5>
 
Last edited:
Ive got help with update/change in lua from Cykotitan and Gce

This is example for get premiumpoint in quest chest
In functions:
PHP:
function doPlayerAddPremiumPoints(cid, points)
    return db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end

The chest.lua
PHP:
local cfg = {
	points = 100,  // How many points
	effect = CONST_ME_MAGIC_GREEN
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 1010 then
queststatus = getPlayerStorageValue(cid,1015)
if queststatus == -1 or queststatus == 0 then
doPlayerSendTextMessage(cid,22,"D-lair quest completa!")
item_uid = doPlayerAddItem(cid,2392,1)
setPlayerStorageValue(cid,1015,1)
			doPlayerAddPvpPoints(cid, cfg.points)
			doCreatureSay(cid, "You have received " .. cfg.points .. " war points!", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getThingPos(cid), cfg.effect)

else
doPlayerSendTextMessage(cid,22,"Vazio.")
end
else
return 0
end
return 1
end
 
Last edited:
Back
Top Bottom