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

Talkactions - !light not disable loggout

Forkz

Well-Known Member
Joined
Jun 29, 2020
Messages
380
Solutions
1
Reaction score
89
Hi otlanders,

I'm using this code below, but when the player logs off the char and logs in again, the "light" is activated but does not appear in-game, then the player has to "disable" and "enable" again to work.

Any suggestions on how to disable when the player logs out?

Lua:
local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 8)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 215)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)

function onSay(cid, words, param)
if getPlayerStorageValue(cid, 54448) ~= 1 then
doAddCondition(cid, condition)
setPlayerStorageValue(cid, 54448, 1)
else
doRemoveCondition(cid, CONDITION_LIGHT)
setPlayerStorageValue(cid, 54448, 0)
end
return TRUE
end
 
Solution
Lua:
function onLogin(cid)
    if getPlayerStorageValue(cid, 54448) == 1 then
        addEvent(doCreatureExecuteTalkAction, 50, cid, "!light")
        addEvent(doCreatureExecuteTalkAction, 100, cid, "!light")
    end
    return true
end
Lua:
function onLogin(cid)
    if getPlayerStorageValue(cid, 54448) == 1 then
        addEvent(doCreatureExecuteTalkAction, 50, cid, "!light")
        addEvent(doCreatureExecuteTalkAction, 100, cid, "!light")
    end
    return true
end
 
Solution
Back
Top