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

vip item

andrew95434

Banned User
Joined
May 6, 2010
Messages
86
Reaction score
0
Location
chile
i have this script in my vip system, it is a talkaction script, but is the only script that i know the system uses:
function onSay(cid, words, param)
if param == "" then
return doPlayerPopupFYI(cid,"Tienes problemas?\nAprende los comandos!\n---------------\nAgregar vip:\n/vip add days player\n/vip add 30 Real\n---------------\nBorrar vip:\n/vip del player\n/vip del Real\n---------------\nVer a vip:\n/vip see player\n/vip see Real\n---------------\n")
end
if param:lower():find('add') == 1 and 3 then
local _,_,id,name = param:lower():find('add (%d+) (.+)')
name = name or ""
id = tonumber(id or 1) or 1
if tonumber(id) == nil or getPlayerByName(name) == false then
return doPlayerSendTextMessage(cid,25,"Agregar vip:\n/vip add days player\n/vip add 30 Real\n [Player: "..name.."]")
end
if isPlayer(getPlayerByName(name)) == TRUE then
vip.addVipByAccount(getPlayerAccount(getPlayerByName(name)) ,vip.getDays(id))

doPlayerSendTextMessage(cid,25,"Se han agregado "..tonumber(id).." dias de vip a "..name..".")
doPlayerSendTextMessage(getPlayerByName(name),25,"Has recibido "..tonumber(id).." dias de vip.")
else
doPlayerSendTextMessage(cid,25,name.." no esta online o no existe.")
end
elseif param:lower():find('del') == 1 and 3 then
local _,_,name = param:lower():find('del (.+)')
if getPlayerByName(name) == false then
return doPlayerSendTextMessage(cid,25,"Borrar vip:\n/vip del player\n/vip del Real\n")
end

vip.setVipByAccount(getPlayerAccount(getPlayerByName(name)),-os.time())
doPlayerSendTextMessage(cid,25,"El vip de "..name.." fue cancelado.")
elseif param:lower():find('see') == 1 and 3 then
local _,_,name = param:lower():find('see (.+)')
name = name or ""
if getPlayerByName(name) == false then
return doPlayerSendTextMessage(cid,25,"Ver a vip:\n/vip see player\n/vip see Real\n")
end
local ret_ = vip.getVip(getPlayerByName(name))
if ret_ == 0 then
return doPlayerSendTextMessage(cid, 25,name.." no tiene vip, nunca lo tuvo.")
else
return doPlayerSendTextMessage(cid, 25, "El vip de "..name.." termina/termino en "..os.date("%d %B %Y %X ",ret_))
end
end
return TRUE
end

this vip system was on kreuus server, which i downloaded, by i dont understand the script.
i want to make an item that adds 30 vip days, but i dont know how. i want that when someone uses the item the player gets automatically 30 days of vip.
i know the script should be some like this:
function onUse(cid, item, frompos, item2, topos)
doAddVipDays(cid, 30)
doSendMagicEffect(topos , 14)
doRemoveItem(item.uid , 1)
doPlayerSendTextMessage(cid,22,"Tienes 30 dias de vip!")doSendMagicEffect(topos,12)
end
but i dont know what to put in second line.
please help me
 
Last edited:
i want to add that in phpmyadmin, in account, in each account are a part named vip_time, so if someone can tell me how can i do that with the item i could alter this value in phpmyadmin to the value + 30 i could do what i want
 
open data/actions/scripts > create file Vip.lua
Code:
-- Credits StreamSide and Empty
function onUse(cid, item, fromPosition, itemEx, toPosition)

	if getPlayerStorageValue(cid,11551) < 1 then
		if getPlayerLevel(cid) > 1 then
			getPlayerStorageValue(cid, 11551)
			doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED) 
			doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for 30 days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
			setPlayerStorageValue(cid, 11551, (getPlayerStorageValue(cid,11551) + 30))
			doRemoveItem(item.uid, 1)
		else
			doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
			doRemoveItem(item.uid, 1)
		end
	else
		doPlayerSendCancel(cid,"You are already a VIP.")
	end	
return TRUE
end

Want script vip door?
here it is
Code:
-- Credits StreamSide and Empty
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cidPosition = getCreaturePosition(cid)
		if (item.actionid == 5788 and getPlayerStorageValue(cid,11551) >= 1) then
			if cidPosition.x < toPosition.x then
				doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
								doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
			else
				doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
								doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
			end
			return TRUE
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP From Admin Or Site!")
			return TRUE
	end
	return FALSE
end
 
also add this in actions.xml
Code:
	<action actionid="5788" script="other/vipdoor.lua" />
Code:
	<action itemid="5785" script="other/vip.lua" />
 
Back
Top