搜索
查看: 1873|回复: 0

转F出错,重启前自动转F插件

[复制链接]
发表于 2009-2-24 08:19:38 | 显示全部楼层 |阅读模式 来自 中国–湖南–怀化–鹤城区
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>

  4. #define PLUGIN "Auto ChangeServer"
  5. #define VERSION "1.0"
  6. #define AUTHOR "HXH"

  7. new a=0
  8. new last_temp[64], temp[64], temp_line[128]

  9. public plugin_init()
  10. {
  11.         register_plugin(PLUGIN, VERSION, AUTHOR)
  12. }

  13. public server_frame()
  14. {
  15.         temp_line = ""
  16.         get_time("%H:%M:%S", temp, 63)
  17.         if(a == 0)
  18.         {
  19.                 last_temp = temp
  20.                 a = 1
  21.         }
  22.         else if(!equal(last_temp, temp))
  23.         {
  24.                 new szFile = fopen("addons/amxmodx/configs/ACS.ini", "rt")
  25.                
  26.                 new Buffer[256], file_time[64], file_ip[64]
  27.                
  28.                 while(!feof(szFile))
  29.                 {
  30.                         fgets(szFile, Buffer, 255)
  31.                        
  32.                         if((strlen(Buffer) < 2) || Buffer[0] == ';')
  33.                                 continue
  34.                        
  35.                         parse(Buffer, file_time, 63, file_ip, 63)
  36.                        
  37.                         if(!equal(file_time, temp)) continue
  38.                        
  39.                         doAction(file_ip)
  40.                 }
  41.                 fclose(szFile)
  42.                
  43.                 last_temp = temp
  44.         }
  45. }

  46. doAction(ip[])
  47. {
  48.         for(new i = 0; i < 33 ; i++)
  49.                 if(is_user_connected(i) || is_user_connecting(i))
  50.                         client_cmd(i, "connect ^"%s^"", ip)
  51. }
复制代码
是不是代码出现问题了?在增加的时间上,自动转不进指定服务器?
游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表