|
发表于 2009-2-24 08:19:38
|
显示全部楼层
|阅读模式
来自 中国–湖南–怀化–鹤城区
- #include <amxmodx>
- #include <amxmisc>
- #include <engine>
- #define PLUGIN "Auto ChangeServer"
- #define VERSION "1.0"
- #define AUTHOR "HXH"
- new a=0
- new last_temp[64], temp[64], temp_line[128]
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- }
- public server_frame()
- {
- temp_line = ""
- get_time("%H:%M:%S", temp, 63)
- if(a == 0)
- {
- last_temp = temp
- a = 1
- }
- else if(!equal(last_temp, temp))
- {
- new szFile = fopen("addons/amxmodx/configs/ACS.ini", "rt")
-
- new Buffer[256], file_time[64], file_ip[64]
-
- while(!feof(szFile))
- {
- fgets(szFile, Buffer, 255)
-
- if((strlen(Buffer) < 2) || Buffer[0] == ';')
- continue
-
- parse(Buffer, file_time, 63, file_ip, 63)
-
- if(!equal(file_time, temp)) continue
-
- doAction(file_ip)
- }
- fclose(szFile)
-
- last_temp = temp
- }
- }
- doAction(ip[])
- {
- for(new i = 0; i < 33 ; i++)
- if(is_user_connected(i) || is_user_connecting(i))
- client_cmd(i, "connect ^"%s^"", ip)
- }
复制代码 是不是代码出现问题了?在增加的时间上,自动转不进指定服务器? |
|