doPlayerSetStorageValue(uid, key, newValue)
+
getPlayerStorageValue(uid, key)
:/
local Levell = 60
local storage = 9989
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,storage) == 1 then
doPlayerSendTextMessage(cid, 27 , "You can use this only once.")
return TRUE
end
if getPlayerLevel(cid) >= Levell and getPlayerStorageValue(cid,storage) ~= 1 then
setPlayerStorageValue(cid,storage,1)
doPlayerSendTextMessage(cid, 24 , "You are able to open door now.")
doSendMagicEffect(getPlayerPosition(cid),14)
return TRUE
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local reqStorage = 1234 -- Required storage to use the item.
if ((getPlayerStorageValue(cid, reqStorage) > 0) and (getPlayerLevel(cid) > 29) and (getPlayerLevel(cid) < 61)) then
local addStorage = 4321 -- Storage obtained after the use of the item.
setPlayerStorageValue(cid, addStorage, 1)
end
return TRUE
end
local required, used, level = 1234, 5678, 60
function onUse(cid, item, fromPosition, itemEx, toPosition)
return TRUE, getPlayerStorageValue(cid, used) > 0 and doPlayerSendTextMessage(cid, 27, "You can use this only once.") or getPlayerStorageValue(cid, required) > 0 and getPlayerLevel(cid) >= level and getPlayerStorageValue(cid, used) < 1 and setPlayerStorageValue(cid, used, 1) and doPlayerSendTextMessage(cid, 24 , "You are able to open door now.") and doSendMagicEffect(getPlayerPosition(cid),14)
end
lololoolCode:local required, used, level = 1234, 5678, 60 function onUse(cid, item, fromPosition, itemEx, toPosition) return TRUE, getPlayerStorageValue(cid, used) > 0 and doPlayerSendTextMessage(cid, 27, "You can use this only once.") or getPlayerStorageValue(cid, required) > 0 and getPlayerLevel(cid) >= level and getPlayerStorageValue(cid, used) < 1 and setPlayerStorageValue(cid, used, 1) and doPlayerSendTextMessage(cid, 24 , "You are able to open door now.") and doSendMagicEffect(getPlayerPosition(cid),14) end
That's not obfuscated. Not really.
local required, used, level =
1234, 5678, 60
function onUse(cid, item, fromPosition, itemEx, toPosition)
return
TRUE,
getPlayerStorageValue(cid, used) > 0 and
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can use this only once.")
or
(
getPlayerStorageValue(cid, required) > 0 and
getPlayerLevel(cid) >= level and
getPlayerStorageValue(cid, used) < 1 and
setPlayerStorageValue(cid, used, 1) and
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You are able to open door now.") and
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
)
end
lololoolCode:local required, used, level = 1234, 5678, 60 function onUse(cid, item, fromPosition, itemEx, toPosition) return TRUE, getPlayerStorageValue(cid, used) > 0 and doPlayerSendTextMessage(cid, 27, "You can use this only once.") or getPlayerStorageValue(cid, required) > 0 and getPlayerLevel(cid) >= level and getPlayerStorageValue(cid, used) < 1 and setPlayerStorageValue(cid, used, 1) and doPlayerSendTextMessage(cid, 24 , "You are able to open door now.") and doSendMagicEffect(getPlayerPosition(cid),14) end
You don't have to read it as long as it doesn't throw errors.This isn't worth lol'ing for, it's just annoying to read it you know? lol <-- omg o.o
You don't have to read it as long as it doesn't throw errors.