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

uniqueid to VIP items

Exiled Pain

Fervid Learner
Joined
Jan 8, 2008
Messages
552
Reaction score
4
Sup, I was wondering if some one could make a script that works kind of like this:

-You buy a VIP item
-Onces you buy it the gm can set a unique code on that item, so if that item is cloned, they would only clone the item not the unique id, so the other items would be deleted upon a db check by the gm.

Saw something alike in some servers but could someone please help me out with the script.
 
Try this, require ingame itembuying though.

LUA:
local t = { -- table
	['VIP weapon'] = {cost=5,itemid=1852},
	['VIP shield'] = {cost=3,itemid=1582}
	}

function onSay(cid,words,param)
local c,i,s,b,v = t[param].cost,t[param].itemid,1754,1582,getThingPos(cid) -- cost,itemid,global storagevalue,itemid of pay item.
	if t[param] ~= nil then
		if doPlayerRemoveItem(cid,b,c) then
			if getGlobalStorageValue(s) < 10000 then
				doItemSetAttribute(doPlayerAddItem(i),'uniqueid',1000)
				setGlobalStorageValue(s,10000)
				doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'You just bought a '..getItemNameById(i)..' for '..c..' 'getItemNameById(b)..'.')
				doSendMagicEffect(v,CONST_ME_MAGIC_RED)
			else
				doItemSetAttribute(doPlayerAddItem(i),'uniqueid',getGlobalStorageValue(s)+1)
				setGlobalStorageValue(s,getGlobalStorageValue(s)+1)
				doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'You just bought a '..getItemNameById(i)..' for '..c..' 'getItemNameById(b)..'.')
				doSendMagicEffect(v,CONST_ME_MAGIC_RED)
			end
		else
			doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,'You don\'t have '..c..' '..getItemNameById(b)..'!')
			doSendMagicEffect(v,CONST_ME_POFF)
		end
	else
		doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,'Invalid item name.')
	end
	return true
end
 
Back
Top