• 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:
 
LUA:
 local function GetPoints(cid)
local result_plr = db.getResult("SELECT points FROM accounts WHERE `id` = "..getPlayerAccountId(cid)..";");
return tonumber(result_plr:getDataInt("points");
end
local function SetPoints(cid,count)
return db.executeQuery("UPDATE `accounts` SET points = "..count.."  WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
;
end
function onUse(cid,bla bla bla)
local y,z,needPoints = math.random(0,1),GetPoints(cid),100;
if(z >= needPoints) then
if(y)then
doPlayerAddItem(cid,blabla);
else
SetPoints(cid,0);
end
end
return true;
end
 
I know nothing.
I just want one actions
if you have premium points at the mall you get the items in the game.
Example: emporia.vapus.net
 
Last edited:
LUA:
 local function GetPoints(cid)
local result_plr = db.getResult("SELECT points FROM accounts WHERE `id` = "..getPlayerAccountId(cid)..";");
return tonumber(result_plr:getDataInt("points");
end
local function SetPoints(cid,count)
return db.executeQuery("UPDATE `accounts` SET points = "..count.."  WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
;
end
function onUse(cid,bla bla bla)
local y,z,needPoints = math.random(0,1),GetPoints(cid),100;
if(z >= needPoints) then
if(y)then
doPlayerAddItem(cid,blabla);
else
SetPoints(cid,0);
end
end
return true;
end

Once again quas.. This is not C#;. hahha xD
 
LUA:
 local function GetPoints(cid)
local result_plr = db.getResult("SELECT points FROM accounts WHERE `id` = "..getPlayerAccountId(cid)..";");
return tonumber(result_plr:getDataInt("points");
end
local function SetPoints(cid,count)
return db.executeQuery("UPDATE `accounts` SET points = "..count.."  WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
;
end
function onUse(cid,bla bla bla) <--
local y,z,needPoints = math.random(0,1),GetPoints(cid),100;
if(z >= needPoints) then
if(y)then
doPlayerAddItem(cid, 2160, 1);
doPlayerAddItem(cid, 2142, 1);
doPlayerAddItem(cid, 2472, 1);
doPlayerAddItem(cid, 2470, 1);
doPlayerAddItem(cid, 2473, 1);
else
SetPoints(cid,0);
end
end
return true;
end

ACTION ID?
 
Code:
local function getPoints(cid)
	local result = db.getResult("SELECT `points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
	if result:getID() ~= -1 then
		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
		local items = {2160, 2142, 2472, 2470, 2473}
		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
 
Last edited:
Back
Top