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

Checking if player has a target

Cadyan

Well-Known Member
Joined
Mar 30, 2008
Messages
844
Reaction score
63
What am I doing wrong?
Mystic Spirit 0.2.15

Code:
if getCreatureTarget(cid) == nil then
     setPlayerStorageValue(cid, 10000, 0)
     doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have no target!")
else
     setPlayerStorageValue(cid, 10000, 1)
end
 
Last edited:
Code:
if(isCreature(target)) then
    setPlayerStorageValue(cid, 10000, 0)
else
    setPlayerStorageValue(cid, 10000, 1)
end
 
"target" is not a specified value.
I want something that checks if a player has a target, regardless if he is targeting someone. I edited my first post.
 
search in player.cpp
Code:
void Player::onThink(uint32_t interval)

Code:
if(getAttackedCreature())
     setStorage(10000, 1); // if in target
   else
     setStorage(10000, 0);
Paste it in function.
no promise will work.
 
Ok - my server doesn't have viewable source files though. Is there any easy way to figure this out?
Mystic 0.2.15
 

Similar threads

Back
Top