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

Whats wrong with this function?

ohman

Member
Joined
Oct 24, 2008
Messages
290
Reaction score
6
Location
Sweden
Hi! I have a funtion in my battle event (mod).

Code:
function clearTeamEventStorages(cid)
if isInRecruitArea(cid) or isInFightArea(cid) then
doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(cid),10)
end

if isFightOn() then
if isJoiner(cid) then
if isBlue(cid) then
addRedKills()
elseif isRed(cid) then
addBlueKills()
end
doPlayerSendTextMessage(cid,MESSAGE_TYPES["orange"],"You have died in Team-Battle Event.")
end
end

removeFromjoiners(cid)
removeFromBlue(cid)
removeFromRed(cid)
doRemoveCondition(cid)
doRemoveCondition(cid, CONDITION_OUTFIT)

end

The thing is, when this function is used in a login or logout event I get a "Creture not found" Error.

The "recruitArea and "FightArea" arent wrong. This happens to ALL players, not just the players in the event. Everytime someone logout or login, I get this error "creature not found".

When I deleted this function in login and logout , the error stopped. But the event did not work as it should.

Thanks!
 
Last edited:
Can you post the code for these:

removeFromjoiners(cid)
removeFromBlue(cid)
removeFromRed(cid)

and the log including the messages, and a few lines above and below.

BTW:

1. If you have an earlier version of that script, check to see if those three function calls are somewhere inside the if statements. They're run every time the script is called, so at least one is going to fail to match (players can't be both red and blue?) and perhaps all three can fail.

2. Do you need both doRemoveCondition() calls?
 
We need to see more of the codes..
It is like bring a pieace of your broken car to the workshop and ask what is wrong with your car.
 
Back
Top