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

Windows Error on vip

Script
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
     if getPlayerStorageValue(cid,19551) < 1 then
        if getPlayerLevel(cid) > 1 then
            getPlayerStorageValue(cid, 19551)
            doSendAnimatedText(getPlayerPosition(cid), "+15 Vip Days", TEXTCOLOR_YELLOW)
            doSendMagicEffect(getPlayerPosition(cid),27)
            doCreatureSay(cid, "CONGRATULATIONS " ..  name .. "! Now you are a member of the VIP City!!Now you can enter VIP and use unique features!", TALKTYPE_ORANGE_1)
            setPlayerStorageValue(cid, 19551, (getPlayerStorageValue(cid,19551) + 15))
	        doSendMagicEffect(getPlayerPosition(cid),27)
		    doRemoveItem(item.uid, 1)
        else
            doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
        end
     else
        doPlayerSendCancel(cid,"You already used this.")
     end    
return TRUE
end

- - - Updated - - -

BUMP!
 
Go to your phpmyadmin and execute:
SQL:
ALTER TABLE `accounts` ADD
`vipdays` int(11) NOT NULL DEFAULT 0;

go to data/lib
open 050-functions.lua and add this:
Lua:
function getPlayerVipDays(cid)
    local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
        if Info:getID() ~= LUA_ERROR then
        local days= Info:getDataInt("vipdays")
        Info:free()
        return days
    end
     return LUA_ERROR
end
 
function doAddVipDays(cid, days)
    db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
 
function doRemoveVipDays(cid, days)
    db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end

and:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
     if getPlayerVipDays(cid) > 365 then
        if getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "+15 Vip Days", TEXTCOLOR_YELLOW)
            doSendMagicEffect(getPlayerPosition(cid),27)
            doAddVipDays(cid, 15)
            doCreatureSay(cid, "CONGRATULATIONS " ..  name .. "! Now you are a member of the VIP City!!Now you can enter VIP and use unique features!", TALKTYPE_ORANGE_1)
	        doSendMagicEffect(getPlayerPosition(cid),27)
		    doRemoveItem(item.uid, 1)
        else
            doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
        end
     else
        doPlayerSendCancel(cid,"You already used this.")
     end    
return TRUE
end
 
hmm try
Lua:
local days = 15

function onUse(cid, item, fromPosition, itemEx, toPosition)
	vip.addVipByAccount(getPlayerAccount(cid), vip.getDays(days))
	getPlayerStorageValue(cid, 19551)
    doSendAnimatedText(getPlayerPosition(cid), "+15 Vip Days", TEXTCOLOR_YELLOW)
	doCreatureSay(cid, "CONGRATULATIONS " ..  getCreatureName(cid) .. "! Now you are a member of the VIP City!!Now you can enter VIP and use unique features!", TALKTYPE_ORANGE_1)
    doSendMagicEffect(getPlayerPosition(cid),27)
    doRemoveItem(item.uid)
	return true
end
 
Back
Top