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

Solved Bug with vip system

Ashbringer

Almighty Ashe
Joined
Dec 24, 2011
Messages
334
Reaction score
18
Location
Germany
Hey i have bug with my vip system i am using tfs 0.3.7

Code:
[14:18:38.136] [Error - MoveEvents Interface]
[14:18:38.136] data/movements/scripts/viptile.lua:onStepIn
[14:18:38.137] Description:
[14:18:38.137] data/lib/050-function.lua:2: attempt to concatenate a boolean value
[14:18:38.137] stack traceback:
[14:18:38.137]  data/lib/050-function.lua:2: in function 'getPlayerVipDays'
[14:18:38.138]  data/movements/scripts/viptile.lua:2: in function <data/movements/scripts/viptile.lua:1>


[14:18:35.114] [Error - MoveEvents Interface]
[14:18:35.115] data/movements/scripts/viptile.lua:onStepIn
[14:18:35.115] Description:
[14:18:35.115] (internalGetPlayerInfo) Player not found when requesting player info #19

@Limos
 
are you sure that this function " getPlayerVipDays "

srry for double post o.o stupid phone xD
Are u sure that this function " getPlayerVipDays " exist in functions on lib folder ?

also post the movements script and the part on functions speak about vip days
 
Last edited by a moderator:
your making a script on a tile with a unique id & if someone has vip days>=1 he can access it?

Post your script, let me check whats wrong with it (im pretty sure you forgot to add that function in data/lib/functions.lua)

edit: if your action script works copy the function from there and post it in your movements script, maybe you misspelled it
 
srry for double post o.o stupid phone xD
Are u sure that this function " getPlayerVipDays " exist in functions on lib folder ?
i added this for the vip system in functions
Code:
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

@ghettobird is this right?

and this is viptile.lua in movements
@ghettobird

Code:
function onStepIn(cid, item, position, fromPosition)
if getPlayerVipDays(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
end
return true
end
 
Last edited by a moderator:
try this,
Code:
function onStepIn(cid, item, position, fromPosition)
if (not isPlayer(cid) then
return true
end
if getPlayerVipDays(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
end
return true
end
 
try this,
Code:
function onStepIn(cid, item, position, fromPosition)
if (not isPlayer(cid) then
return true
end
if getPlayerVipDays(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
end
return true
end
btw i restarted my ot just to check and the error havent appear yet :D

btw i restarted my ot just to check and the error havent appear yet :D
so if the error appear i gonna try your script
 
Last edited by a moderator:
@viktorhubinette was that after you tried what i said or before? :p


edit: okay
the error is back again gonna try your now

@viktorhubinette was that after you tried what i said or before? :p


edit: okay
got this error
Code:
Loading movements... [Error - LuaInterface::loadFile] data/movements/scripts/viptile.lua:2: ')' expected near 'then'
[16:25:42.771] [Error - Event::checkScript] Cannot load script (data/movements/scripts/viptile.lua)
[16:25:42.771] data/movements/scripts/viptile.lua:2: ')' expected near 'then'

and i also have this error before i tried your script
Code:
 [Error - MoveEvents Interface]
[16:25:06.842] data/movements/scripts/viptile.lua:onStepIn
[16:25:06.843] Description:
[16:25:06.843] (internalGetPlayerInfo) Player not found when requesting player info #19
 
Last edited by a moderator:
Code:
function onStepIn(cid, item, position, fromPosition)
if (not isPlayer(cid)) then
return true
end
if getPlayerVipDays(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
end
return true
end
 
Code:
function onStepIn(cid, item, position, fromPosition)
if (not isPlayer(cid)) then
return true
end
if getPlayerVipDays(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
end
return true
end
 
Last edited by a moderator:
Back
Top