• 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!

Quest of donation points

Swizi

New Member
Joined
Aug 5, 2008
Messages
87
Reaction score
0
Sup guys. im searching for some help, im gonna make a really hard quest (maybe the hardest on my server ) and i wanna know if its possible to make special reward at the end. Instead of making items / exp as a reward for making the quest i want it to be donation points. So when a player clicks on the chest he will get X ammount of points added to he's account.

Is that possible to make, if it is could someone help me out to make that script? :peace:
 
Yes, simple. Just remove the line of the script that adds an item, and replace it with a db function that modifies a table. You can find both by searching
 
Took a stab at it, if its wrong I'd appreciate if someone could point out what, I'm learning.

Lua:
local query = {yourquerygoeshere}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 700) == false then
		db.executeQuery(query)
		doPlayerSendTextMessage(cid, 21, "x donation points have been credited to your account!")
		setPlayerStorageValue(cid, 700)
	else
		doPlayerSendCancel(cid,"You have already done this quest.")
	return TRUE
end
 
Last edited:
I know.

Lua:
query = {yourquerygoeshere}

I don't know how to write query's so I figured he can search for it. Forgot to add local, but added it.
 
and
Code:
setPlayerStorageValue(cid, 700, 1)
should be changed to
Code:
setPlayerStorageValue(cid, 700)

Since you are just checking for the storage, not the value (don't know what it is called)
 
Code:
local howmuch = 100 --how much points the quest will add
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid, 700) < 1 then
                db.executeQuery(db.executeQuery("UPDATE `accounts` SET `premium_points`=`premium_points`+' ..howmuch.. ' WHERE `name` = '' ..getPlayerAccount(cid).. '';"))
                doPlayerSendTextMessage(cid, 21, " '..howmuch.. ' donation points have been credited to your account!")
                setPlayerStorageValue(cid, 700, 1)
        else
                doPlayerSendCancel(cid,"You have already done this quest.")
        return TRUE
		end

I hope it will work :)

@down
First ;p
 
Last edited:
Code:
local t = {
	storage = 700,
	points = 10
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, t.storage) < 1 then
		db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. t.points .. " WHERE `name` = '" .. getPlayerAccount(cid) .. "';")
		doPlayerSendTextMessage(cid, 21, t.points .. ' donation points have been credited to your account!')
		setPlayerStorageValue(cid, t.storage, 1)
	else
		doPlayerSendCancel(cid, 'You have already done this quest.')
	end
	return true
end
and
Code:
[B][COLOR="Red"]set[/COLOR][/B]PlayerStorageValue(cid, 700, 1)
should be changed to
Code:
[B][COLOR="Red"]set[/COLOR][/B]PlayerStorageValue(cid, 700)

Since you are just checking for the storage, not the value (don't know what it is called)
no.
 
Back
Top Bottom