• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua VIP items possible?

volitar

New Member
Joined
Dec 2, 2008
Messages
61
Reaction score
0
hello... i have problems with fixing some items..

like get a rune like uh. and make it only usable if you have VIP..

PHP:
function getPlayerStorageValue(cid,11551) >= 1) then
		doCreatureSay(cid, "VIP Healing!", TALKTYPE_ORANGE_1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can use this! Buy VIP on our homepage.")
	
	return
end

does not work to put in spell just stop working..


//volitar
 
Inside the UH script you need to add this

LUA:
if getPlayerStorageValue(cid, 11551) >= 1 then 
     doCreatureSay(cid, "VIP Healing!", TALKTYPE_ORANGE_1) 
else 
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can use this! Buy VIP on our homepage.") 
    
end
 
Inside the UH script you need to add this

LUA:
if getPlayerStorageValue(cid, 11551) >= 1 then 
     doCreatureSay(cid, "VIP Healing!", TALKTYPE_ORANGE_1) 
else 
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can use this! Buy VIP on our homepage.") 
    
end


tryed dont work got error.

creature not found. compare number with boolean that is what the errors are.:/
 
tryed dont work got error.

creature not found. compare number with boolean that is what the errors are.:/

PHP:
<action itemid="ID" event="script" value="vip.lua" allowfaruse="1"/>
vip.lua
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPlayer(itemEx.uid) then
		return false
	elseif(getPlayerStorageValue(cid, 11551) >= 1)
		doCreatureAddMana(itemEx.uid,500)
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
		return true
	else
		 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can use this! Buy VIP on our homepage.") 
	end
end
 

PHP:
<action itemid="ID" event="script" value="vip.lua" allowfaruse="1"/>
vip.lua
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPlayer(itemEx.uid) then
		return false
	elseif(getPlayerStorageValue(cid, 11551) >= 1)
		doCreatureAddMana(itemEx.uid,500)
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
		return true
	else
		 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can use this! Buy VIP on our homepage.") 
	end
end

still get bugs:/...

fixed put 'then' after elseif(getPlayerStorageValue(cid, 11551) >= 1)..

but got other problem.- even when i have vip account i cat use it say i dont have vip

is it any sql code i need to put in to get the vip to player from account or what?
 
Last edited:
try now:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPlayer(itemEx.uid) then
		return false
	elseif(getPlayerStorageValue(cid, 11551) >= 1) then
		doCreatureAddMana(itemEx.uid,500)
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
		return true
	else
		 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can use this! Buy VIP on our homepage.") 
	end
end
 

PHP:
<action itemid="ID" event="script" value="vip.lua" allowfaruse="1"/>
vip.lua
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPlayer(itemEx.uid) then
		return false
	elseif(getPlayerStorageValue(cid, 11551) >= 1) then
		doCreatureAddMana(itemEx.uid,500)
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
		return true
	else
		 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can use this! Buy VIP on our homepage.") 
	end
end
Brutal.

You should know that
LUA:
getThingPos(itemEx.uid) == toPos

Fixed, but not tested:
LUA:
function onUse(cid, item, fromPos, itemEx, toPos)
	if (not isPlayer(itemEx.uid)) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can use potions only for players.") 
	elseif (getCreatureStorage(cid, 11551) >= 1) then
		doCreatureAddMana(itemEx.uid, 500)
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
		doSendMagicEffect(toPos, CONST_ME_MAGIC_BLUE)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can use this! Buy VIP on our homepage.") 
	end
	return true
end
 
Last edited:
thx. the rune "works" i think.. the problem is not that script right now. i need to have like vip status on player or something account got vip but cant get it to work.
 
Back
Top