Jump to content
  • 0

Please explain


Mabuhay

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

if( battle_config.afk_timeout )
        {
             int timeout = atoi(message);
             status_change_start(NULL, &sd->bl, SC_AUTOTRADE, 10000,0,0,0,0, ((timeout > 0) ? min(timeout,battle_config.afk_timeout) : battle_config.aa_timeout)*60000,0);
        }
 

can anyone explain that code for me? as much as possible, line by line. cuz i wanna learn src mod :3

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

if you have set afk_timeout ... then ...

convert  the value inside message variable into integer ....

if the timeout( converted value ) larger than 0 .....@afk for a limited duration ...

else...@afk unlimit time.

 

afk_timeout = setting inside conf files
timeout = minutes for @afk ( integer form )
message = minutes for @afk ( string form )
min( x,y ) = limit the value between x and y 

 

 

 

and..a typo mistake in 

 

battle_config.aa_timeout
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Thanks emistry.



PS: btw, how about this part sir emistry?

status_change_start (NULL, &sd->bl, SC_AUTOTRADE, 10000,0,0,0,0, ...
Edited by MrVandalBus
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

add the SC_AUTOTRADE ....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

should have thought of that @_@ thanks again

Link to comment
Share on other sites

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...