• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

OnLogin [Maybe C++ included]

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Hello guys,
today i tried to write a system without success, can someone help?

Details:
TIME = 5 //Configurable in config.lua, in seconds
1. When player login, monsters will not see/attack/follow him in first TIMEseg. (Monsters must ignore player)
2. Monsters will only attack player before TIME runs out if He moves and/or attacks
 
Maybe it can be done like this:

LUA:
local storage = 1000

function onTarget(cid, target)
if isMonster(cid) and isPlayer(target) then 
if getPlayerStorageValue(target, storage) >= 1 then return false end
end
end

LUA:
function onLogin(cid)
if isPlayer(cid) then
setPlayerStorageValue(cid,1000, 1)
addEvent(setPlayerStorageValue(cid, 5*60, 1000, 0))
end
end
 
Back
Top