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

Function (training)

Godely

Member
Joined
Aug 19, 2007
Messages
233
Reaction score
19
Hello... Today I was implanting a train code (from a guy I forgot the name)... and I did some changes... So, here is my question:

Code:
function doPlayerEndTraining(cid)
    if isPlayerTraining(cid) == TRUE then
        doTeleportThing(cid, TRAIN_EXIT_POS, FALSE)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        stopEvent(event1)
        stopEvent(event2)
    end
end

 function doPlayerExtendTraining(cid)
    event1 = addEvent(setPlayerTrainCode, TRAIN_TIME * 1000 * 10, cid)
    event2 = addEvent(isItEndOfTraining, (TRAIN_TIME * 1000 * 10) + 10000, cid)
end

So, the problem is: they are on functions.lua, in separated functions, but I want the "event1" stop in the other function as a "stopEvent". How do I do that?

Thanks, bye.
 
PHP:
function doPlayerEndTraining(cid)
    if isPlayerTraining(cid) == TRUE then
        doTeleportThing(cid, TRAIN_EXIT_POS, FALSE)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        stopEvent(event1)
        stopEvent(event2)
    end
end

 function doPlayerExtendTraining(cid)
    event1 = addEvent(setPlayerTrainCode, TRAIN_TIME * 1000 * 10, cid)
    event2 = addEvent(isItEndOfTraining, (TRAIN_TIME * 1000 * 10) + 10000, cid)
stopEvent(event1)
end

... like that?
 
Back
Top