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

Lua This scrpit only vip can use

guigui768

New Member
Joined
Oct 11, 2010
Messages
81
Reaction score
1
PHP:
local config = {
	rate = 2.0, -- 4x More Experience
	time = 1, -- Hours of Exp Time
	storage = 20012
}

local function endExpRate(cid)
	if isPlayer(cid) == TRUE then
		doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
		setPlayerStorageValue(cid, config.storage, -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
	end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStorageValue(cid, config.storage) < 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hours.")
		doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
		setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600)
		addEvent(endExpRate, config.time * 3600 * 1000, cid)
		doRemoveItem(item.uid, 1)
	else

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.")

	end
	return TRUE
end


I would like that this scrpit just vip players can use...
I think the function is that:

if not(isVip(cid)) then
doPlayerSendTextMessage(cid, 22, "Você precisa ser VIP para utilizar esse item.")


But i dont know where i have to put this..
 
try
Code:
local config = {
    rate = 2.0, -- 4x More Experience
    time = 1, -- Hours of Exp Time
    storage = 20012
}

local function endExpRate(cid)
    if isPlayer(cid) == TRUE then
        doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
        setPlayerStorageValue(cid, config.storage, -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
    end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not(isVip(cid)) then
   doPlayerSendTextMessage(cid, 22, "Você precisa ser VIP para utilizar esse item.") 
else
        if(getPlayerStorageValue(cid, config.storage) < 0) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hours.")
        doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
        setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600)
        addEvent(endExpRate, config.time * 3600 * 1000, cid)
        doRemoveItem(item.uid, 1)
    else

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.")

    end
    return TRUE
end
end
 
Back
Top