Jump to content
  • 0

help of the checkidle command


Eyhra

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   6
  • Joined:  04/30/14
  • Last Seen:  

checkidle()
hello, could someone help me with this problem that I have, I am using the checkidle command but, my problem is that I keep counting the tic even when you are dead, which keeps me counting the time to be AFK and throw them away even if they are dead Are there Any way that the command validates, if it is dead and stops counting, and when reviving the count is reset?
 

BUILDIN_FUNC(checkidle)
{
	TBL_PC *sd = NULL;

	if (script_hasdata(st, 2))
		sd = map_nick2sd(script_getstr(st, 2));
	else
		sd = script_rid2sd(st);

	if (sd)
		script_pushint(st, DIFF_TICK(last_tick, sd->idletime));
	else
		script_pushint(st, 0);
	return 0;
}

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...