• 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 System Error, HELP

Exedion

Active Member
Joined
Jun 11, 2007
Messages
628
Reaction score
30
Hello to all in otland! well, i have some time without post anything in this forum, but i need professional help ^^ i'm making my own VIP System for my coming soon distro, but i don't have experience with that system... i'm making one idea for the exp stages with your player status, example:

- if your player is free account, the exp stage work normaly for you
- if your player have premium account, will add +1 to your exp stage
[premium exp stage = 5+1 = 6]
- if your player is free account with vip feature, will add +1 to your exp stage
[normal+vip exp stage = 5+1 = 6]
- if you have premium account and vip feature, the player exp stage will add +2
[premium+vip exp stage = 5+2 = 7]

this will affect all exp stages, example:

[level 8 to level 20 = 5 exp stage +2 premium-vip stage = 7]
[level 20 to level 30 = 4 exp stage +2 premium-vip stage =6]

i make one script and one function for this, i think no have error but when i trie login in the world, the player logout at the same time!

take a look of the script:

Version 1.0
Code:
stages = {normal = 0}, {premium = 1}, {vip = 2}

function onLogin(cid)
	if isPlayer == TRUE and isPremium == FALSE and isVIP == FALSE then
		exp = stages.normal
	elseif isPlayer == TRUE and isPremium == TRUE and isVIP == FALSE then
		exp = stages.premium
	elseif isPlayer == TRUE and isPremium == FALSE and isVIP == TRUE then
		exp = stages.premium
	elseif isPlayer == TRUE and isPremium == TRUE and isVIP == TRUE then
		exp = stages.vip
	end
		
	return setPlayerExtraExpRate(cid, exp)

end

Version 2.0
Code:
function onLogin(cid)

local normal = 0
local premium = 1
local vip = 2

	if isPlayer == TRUE and isPremium == FALSE and isVIP == FALSE then
		setPlayerExtraExpRate(cid,normal)
	elseif isPlayer == TRUE and isPremium == TRUE and isVIP == FALSE then
		setPlayerExtraExpRate(cid,premium)
	elseif isPlayer == TRUE and isPremium == FALSE and isVIP == TRUE then
		setPlayerExtraExpRate(cid,premium)
	elseif isPlayer == TRUE and isPremium == TRUE and isVIP == TRUE then
		setPlayerExtraExpRate(cid,vip)
	else
		return
	end

end

Function
Code:
function isVIP(cid)
	if(isPlayer(cid) == FALSE) then
		debugPrint("isVIP: Player not found.")
		return false
	end

	return (isInArray({2}, getPlayerGroupId(cid)) == TRUE)
end

what is wrong?

my vip system is based with groupid, the groupid 2 have vip privilegies and is the checking base for vip areas, but i need a script (don't know how make) with a storageValue, the value is the time when the player make vip, and when the player login, the script compare the storageValue time, with actually time, when passed one month, the script chague the groupid of the player to 1 (normal player), can help?
 
Last edited:
I just made the base for the script, it will set groupId to 1 every 30 days...

PHP:
function onLogin(cid)

local compareStor = 30*24*60*1000
local timeStor = getPlayerStorageValue(cid, 5556)

	if timeStor > 0 and (os.time() - timeStor) >= compareStor then
		setPlayerGroupId(cid, 1)
	end
return TRUE
end
 
Yeah that script works if server is restarted...


Stages:

PHP:
function onLogin(cid)

local normal = 0
local premium = 1
local vip = 2

	if isPlayer(cid) == TRUE and isPremium(cid) == FALSE and isVIP(cid) == FALSE then
		setPlayerExtraExpRate(cid,normal)
	elseif isPlayer(cid) == TRUE and isPremium(cid) == TRUE and isVIP == FALSE then
		setPlayerExtraExpRate(cid,premium)
	elseif isPlayer(cid) == TRUE and isPremium(cid) == FALSE and isVIP(cid) == TRUE then
		setPlayerExtraExpRate(cid,premium)
	elseif isPlayer(cid) == TRUE and isPremium(cid) == TRUE and isVIP(cid) == TRUE then
		setPlayerExtraExpRate(cid,vip)
	end
return TRUE
end

Not tested, if it doesnt work post errors!
 
Yeah that script works if server is restarted...


Stages:

PHP:
function onLogin(cid)

local normal = 0
local premium = 1
local vip = 2

	if isPlayer(cid) == TRUE and isPremium(cid) == FALSE and isVIP(cid) == FALSE then
		setPlayerExtraExpRate(cid,normal)
	elseif isPlayer(cid) == TRUE and isPremium(cid) == TRUE and isVIP == FALSE then
		setPlayerExtraExpRate(cid,premium)
	elseif isPlayer(cid) == TRUE and isPremium(cid) == FALSE and isVIP(cid) == TRUE then
		setPlayerExtraExpRate(cid,premium)
	elseif isPlayer(cid) == TRUE and isPremium(cid) == TRUE and isVIP(cid) == TRUE then
		setPlayerExtraExpRate(cid,vip)
	end
return TRUE
end

Not tested, if it doesnt work post errors!


i test the script, don't show any error in the gui console but they dont work, why?
 
Back
Top