waqmaz
Member
- Joined
- Jun 17, 2015
- Messages
- 203
- Reaction score
- 11
Hello.
I would like to know how does function params really works. I have some problems.
Lets say we have onCombat function:
I wanted to check, when which function is activated, but I can't get it.
Can someone tell me how does it work? I read this phorum and I've discovered if monster is attacker then player should be cid and if player is cid, then monster should be attacker (onStatsChange). If player is target, then monster is cid, if monster is cid, then player is target.
Sometimes it doesn't work. Does it depend if event is registered to monster or is not? Please, help. Thanks.
What does really mean that for example monster is cid?
What does mean if player(target) == cid?
Please, help.
I would like to know how does function params really works. I have some problems.
Lets say we have onCombat function:
Code:
function onCombat(cid, target)
-- cid = getCreatureTarget(cid)
-- target = getCreatureTarget(target )
if isPlayer(target) then
doCreatureSay(cid, "isPlayer(target)", TALKTYPE_ORANGE_1)
end
if isPlayer(cid) then
doCreatureSay(cid, "isPlayer(cid)", TALKTYPE_ORANGE_1)
end
if isMonster(target) then
doCreatureSay(cid, "isMonster(target)", TALKTYPE_ORANGE_1)
end
if isMonster(cid) then
doCreatureSay(cid, "isMonster(cid)", TALKTYPE_ORANGE_1)
end
return true
end
I wanted to check, when which function is activated, but I can't get it.
Can someone tell me how does it work? I read this phorum and I've discovered if monster is attacker then player should be cid and if player is cid, then monster should be attacker (onStatsChange). If player is target, then monster is cid, if monster is cid, then player is target.
Sometimes it doesn't work. Does it depend if event is registered to monster or is not? Please, help. Thanks.
What does really mean that for example monster is cid?
What does mean if player(target) == cid?
Please, help.
Last edited: