[摳頂] times_check.c

看板mud_sanc (Sanctuary - 聖殿)作者 (小太保)時間12年前 (2013/08/05 22:12), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
// times_check.c // 這東西以後可以擴大應用 // Laechan@Sanc 2013/08/05 inherit ROOM; mapping times_check=([]); static int x; void create() { ::create(); setuid(getuid(this_object())); if(file_exists("/open/cmds/times_check.o")) restore_object("/open/cmds/times_check"); set_heart_beat(1); } int save_room() { save_object("/open/cmds/times_check"); return 1; } int times_check(int t) { string tmp,tmp2; mixed tmps=({}),tmps2=({}); object ppl; tmps=keys(times_check); foreach(tmp in tmps) { if(atoi(tmp)>t) continue; tmps2=keys(times_check); foreach(tmp2 in tmps2) { if(!ppl=find_player(tmp2)) continue; // 由各藥品寫 cancel_effect catch(call_other(times_check[tmp][tmp2][0],"cancel_effect", ppl,times_check[tmp][tmp2][1])); } map_delete(times_check,tmp); } save_room(); return 1; } void set_times_check(string names,string files,string med_names,int t) { t=t+time(); if(!times_check[""+t]) times_check[""+t]=([]); times_check[""+t][names]=({files,med_names}); } int heart_beat() { x=x+1; if(x%15!=2) return 1; times_check(time()); return 1; } -- ※ 發信站: 批踢踢實業坊(ptt.cc)

08/05 23:32, , 1F
明天先實驗這東西會不會 work
08/05 23:32, 1F
※ 編輯: laechan 來自: 210.61.157.53 (08/06 08:58)
文章代碼(AID): #1H_xBAxs (mud_sanc)
文章代碼(AID): #1H_xBAxs (mud_sanc)