PB3LL
Member
- Joined
- Oct 30, 2015
- Messages
- 60
- Reaction score
- 9
has anyone ever encountered this issue?
for some reason I am only able to set values to '0' or '1' when using lua.
i can manually change values in database of course.
when i use setPlayerStorageValue(cid, 92000, 0) = it works
when i use setPlayerStorageValue(cid, 92000, 1) = it works
when i use setPlayerStorageValue(cid, 92000, 2) = it does not work
when i use setPlayerStorageValue(cid, 92000, 3) = it does not work
etc.
anyone have any ideas why??
thanks for any help.
here is the talkaction script. perhaps it has errors i am not seeing that is causing the storage 92000 to not be set to 3.
for some reason I am only able to set values to '0' or '1' when using lua.
i can manually change values in database of course.
when i use setPlayerStorageValue(cid, 92000, 0) = it works
when i use setPlayerStorageValue(cid, 92000, 1) = it works
when i use setPlayerStorageValue(cid, 92000, 2) = it does not work
when i use setPlayerStorageValue(cid, 92000, 3) = it does not work
etc.
anyone have any ideas why??
thanks for any help.
here is the talkaction script. perhaps it has errors i am not seeing that is causing the storage 92000 to not be set to 3.
Lua:
local config = {
room = {x = 1072, y = 1020, z = 7}, -- location in room
name = "town a trainers" -- name of location where players are sent
}
function onSay(cid, words, param)
if exhaustion.get(cid, 101) then
doPlayerSendCancel(cid, 'You are exhausted.')
return true
end
exhaustion.set(cid, 101, 60)
if(param == '') and getPlayerStorageValue(cid, 42000) == 0 and getPlayerStorageValue(cid, 92000) == 0 then
if(getPlayerLevel(cid) < 200) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be between levels 200 and 209 to go there.")
elseif(getPlayerLevel(cid) > 209) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be between levels 200 and 209 to go there.")
else
local result = {}
result = db.getResult("SELECT * FROM player_trainers WHERE id = 3")
if result:getID() ~= -1 then
local maximumTrainers = 10
local currentTrainers = result:getDataInt("current")
result:free()
if currentTrainers < maximumTrainers then
db.executeQuery("UPDATE player_trainers SET current = current + 1 WHERE id = 3")
end
end
doTeleportThing(cid, config.room)
setPlayerStorageValue(cid, 92000, 3)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have joined the " ..config.name .." !")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
end
end
return true
end
Last edited by a moderator: