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

GesiorACC Click Item

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
I wanted a scripter, you have X points in the shopping gesior acc.
You go on the server, and click the item and you win the item, you will lose points at the shopping ^_^

Rep++ :wub::wub: :thumbup:
 
I know.

but I do not understand anything! example of action
LUA:
<action actionid="5000-5010" script="gesior.lua" /> CORRECT?

EXEMPLE:

LUA:
		local items = 
{2160 = ACTIONID 5000
{2142 = ACTIONID 5001
 
<action actionid="5000" event="script" value="gesior.lua" />

and use the one existance gave you
Code:
local function getPoints(cid)
    local result = db.getResult("SELECT `points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
    if result:getID() ~= -1 then
        result:free()
        return result:getDataInt("points")
    end
end
local function setPoints(cid, count)
    return db.executeQuery("UPDATE `accounts` SET `points` = `points` - " .. count .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPoints(cid) >= 100 then
        [COLOR=Red]local items = {2160, 2142, 2472, 2470, 2473}[/COLOR]
        if math.random(0, 1) then
            for i = 1, #items do
                doPlayerAddItem(cid, items[i], 1)
            end
            setPoints(cid, 100)
        else
            setPoints(cid, 100)
        end
    else
        doPlayerSendTextMessage(cid, 27, "You dont have enough points.")
    end
    return true
end
and add item ids at the red line
 
<action actionid="5000" event="script" value="gesior.lua" />

and use the one existance gave you
Code:
local function getPoints(cid)
    local result = db.getResult("SELECT `points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
    if result:getID() ~= -1 then
        result:free()
        return result:getDataInt("points")
    end
end
local function setPoints(cid, count)
    return db.executeQuery("UPDATE `accounts` SET `points` = `points` - " .. count .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPoints(cid) >= 100 then
        [COLOR=Red]local items = {2160, 2142, 2472, 2470, 2473}[/COLOR]
        if math.random(0, 1) then
            for i = 1, #items do
                doPlayerAddItem(cid, items[i], 1)
            end
            setPoints(cid, 100)
        else
            setPoints(cid, 100)
        end
    else
        doPlayerSendTextMessage(cid, 27, "You dont have enough points.")
    end
    return true
end
and add item ids at the red line

I KNOW!

EXEMPLE:
local items = {2160 = POINTS,ACTIONID
2142 = POINTS,ACTIONID
2472 = POINTS,ACTIONID
2470 = POINTS,ACTIONID

LUA:
	local shop = {
		[5000]ID = {
			id = ID ITEM, points = 2000
		},
		[5001] = {
			id = ID ITEM, points = 7876
 
Since you guys think that you can chat wherever you want without following rules I will make it clear and simple for you. Next one to post something irrelevant will be given an infraction. However, this does not apply for Existance and Cykotitan. You two are going to be banned for 1 week due to your high amount of infractions and your low understanding.
 
Since you guys think that you can chat wherever you want without following rules I will make it clear and simple for you. Next one to post something irrelevant will be given an infraction. However, this does not apply for Existance and Cykotitan. You two are going to be banned for 1 week due to your high amount of infractions and your low understanding.

Who died!?!?!?

why bold red text.. :S
 
Last edited:
Back
Top