The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
critical problem
Author Message
Runcuks
Journeyman
*

Posts: 179
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Nov 2012
Reputation: 0



Post: #7
RE: critical problem
emm yes, i need this because i use it for events..
i will give you a sample of it...
Code:
[function check_ip_event]
//function chechks if players ip has been used in last 15 minutes
//because only 1 ip per char can be on event
db.query "SELECT * FROM `events_ips` WHERE `event`='<argv[0]>' AND `ip`='<account.lastip>';"
if (!<db.row.numrows>)
   // if didn't find, then add ip
   db.execute "INSERT INTO `events_ips` (`event`, `ip`, `time`) VALUES('<argv[0]>', '<account.lastip>', '<unix_time>');"
   return 0
else
   //if found ip, then check if 10 minutes have passed
   local.db_fix = <db.row.0.time>
   local.total = <eval <unix_time> - <local.db_fix>>
   if (<local.total> > 600)
      // if 10 mintes has passed
      db.execute "UPDATE `events_ips` SET `time`=<unix_time> WHERE `event`='<argv[0]>' AND `ip`='<account.lastip>';"
      return 0
   else
      // this ip has been used for last 10 mintes, can't add repeatedly
      return 1
   endif
endif
(This post was last modified: 12-06-2014 05:26 AM by Runcuks.)
12-06-2014 05:25 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
critical problem - Runcuks - 12-05-2014, 04:08 AM
RE: critical problem - Extreme - 12-05-2014, 04:35 AM
RE: critical problem - Runcuks - 12-05-2014, 07:29 AM
RE: critical problem - Extreme - 12-05-2014, 08:12 AM
RE: critical problem - Runcuks - 12-06-2014, 03:46 AM
RE: critical problem - Extreme - 12-06-2014, 04:28 AM
RE: critical problem - Runcuks - 12-06-2014 05:25 AM
RE: critical problem - Extreme - 12-06-2014, 05:47 AM
RE: critical problem - Runcuks - 12-06-2014, 05:50 AM
RE: critical problem - Extreme - 12-06-2014, 06:00 AM
RE: critical problem - darksun84 - 12-06-2014, 06:41 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)