• 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 Someone fix my script

Rab

Member
Joined
Feb 23, 2009
Messages
468
Reaction score
9
Location
ARGENTINA!
Code:
function onLogin(cid)
         if getPlayerVipDays(cid) >= 1 and getPlayerStorageValue(cid,95883) == 1 and getPlayerPromotionLevel(cid) <= 1 then
			db.executeQuery("UPDATE `players` SET `promotion` = `2` WHERE `name` = " .. getCreatureName(cid) .. ";")
			
		elseif getPlayerVipDays(cid) == 0 and getPlayerPromotionLevel(cid) == 2 then
			db.executeQuery("UPDATE `players` SET `promotion` = `1` WHERE `name` = " .. getCreatureName(cid) .. ";")
		
		return FALSE
end

What i wanted to do is this:
You get on a character, it checks if its vip, if storage 1, give promotion2, if not vip, promotion1.
 
Code:
function onLogin(cid)
	if getPlayerVipDays(cid) > 0 and getPlayerStorageValue(cid,95883) == 1 and getPlayerPromotionLevel(cid) <= 1 then
		doPlayerSetPromotionLevel(cid, 2)
	elseif getPlayerVipDays(cid) == 0 and getPlayerPromotionLevel(cid) == 2 then
		doPlayerSetPromotionLevel(cid, 1)
	end
	return true
end
 
Back
Top