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

Points Back Script?=

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
can some make so if you put a donate item on tex table and pull a switch you get the points back and the item goes away ? :thumbup:

rep++
 
try , just put a action id on the lever
Lua:
local items = 	{	-- [ item id ] = {points = points will be returned to players}
					[2466] = {points = 5},
					[2446] = {points = 6}
			
				}
local table_place =	{x=92,y=132,z=7}	
function addPoint(cid,p,t)
	return doPlayerSendTextMessage(cid,25,"You have returned your donated item '"..getItemNameById(t).."' and added ".. p .." points to your current one.") and db.executeQuery("UPDATE `accounts` set `premium_points` = `premium_points` + '"..p.."' WHERE `name` = '"..getPlayerAccount(cid).."';")
end
local check = nil
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for k,v in pairs(items) do
		if getTileItemById(table_place,k).uid > 0 then
			check = {k,v.points}
		end
	end
	if check ~= nil then
		addPoint(cid,check[2],check[1])
		doRemoveItem(getTileItemById(table_place,check[1]).uid,1)
		doSendMagicEffect(table_place,2)
		doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
		check = nil
	else
		doPlayerSendCancel(cid,"No donated item can be found.")
		doSendMagicEffect(toPosition,2)
	end
	return true
end
 
Chance This:

function addPoint(cid,p,t)
return doPlayerSendTextMessage(cid,25,"You have returned your donated item '"..getItemNameById(t).."' and added ".. p .." points to your current one.") and db.executeQuery("UPDATE `accounts` set `premium_points` = `premium_points` + '"..p.."' WHERE `name` = '"..getPlayerAccount(cid).."';")
end

for this:

function addPoint(cid,p,t)
return doPlayerSendTextMessage(cid,22,"You have returned your donated item '"..getItemNameById(t).."' and added ".. p .." points to your current one.") and db.executeQuery("UPDATE `accounts` set `premium_points` = `premium_points` + '"..p.."' WHERE `name` = '"..getPlayerAccount(cid).."';")
end

REP ++ =)
 
Back
Top