Advertisement
Guest User

Untitled

a guest
Jan 27th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.13 KB | None | 0 0
  1. //===== eAthena Script =======================================
  2. //= Itemizer
  3. //===== By: ==================================================
  4. //= Latheesan (HeliosRO Server Admin) (C) 2009 HeliosRO.Com
  5. //===== Current Version: =====================================
  6. //= 1.5
  7. //===== Compatible With: =====================================
  8. //= Any SQL eAthena Version
  9. //===== Description: =========================================
  10. //= To prevent GM Corruption, you can disable all item related
  11. //= commands and use this NPC to distribute Items and/or KCP.
  12. //===== Additional Comments: =================================
  13. //= v1.0 - Initial Release (Report Bugs On eAthena Board)
  14. //= v1.1 - Fixed A Few Typo In Script
  15. //= v1.2 - Fixed GM Detection Bug and Cleaned Up The Code
  16. //= v1.3 - Added User Menu In GM Menu
  17. //= v1.4 - Added New @check_online and @notify_player Config
  18. //= v1.5 - Added Announce Feature and code optimized
  19. //============================================================
  20.  
  21. //===== SQL Table ============================================
  22. //= Execute This Query On Your Ragnarok Database Prior To Use.
  23. //=
  24. //CREATE TABLE IF NOT EXISTS `itemizer` (
  25. // `id` int(11) unsigned NOT NULL auto_increment,
  26. // `item_id` int(11) NOT NULL,
  27. // `item_amount` int(11) NOT NULL,
  28. // `item_name` varchar(255) NOT NULL,
  29. // `char_id` int(11) NOT NULL,
  30. // `char_name` varchar(255) NOT NULL,
  31. // `reason` varchar(255) NOT NULL,
  32. // `by_gm` varchar(255) NOT NULL,
  33. // `when` datetime NOT NULL,
  34. // `for` varchar(255) NOT NULL,
  35. // `collected` tinyint(1) NOT NULL,
  36. // PRIMARY KEY (`id`)
  37. //) ENGINE=MyISAM ;
  38.  
  39. //
  40. // Script Interface For Event Prize NPC
  41. //
  42. prt_vilg01,124,120,4 script Itemizer 906,{
  43.  
  44. // Script Config
  45. set @npc$,"^008000[ Itemizer ]^000000"; // NPC Name
  46. // item id range
  47. setarray .@item_id_range,12000,14000;
  48.  
  49. // Advance Script Config
  50. set @dummy_kcp_id,123; // Dummy Item ID Used To Identify If Collection Item == KCP
  51. set @check_weight,1; // 1 == Yes | 0 == No (Check If Player Is Over Weight)
  52. set @min_gm_lvl,60; // Minimum GM Level Required To "Make Item"
  53. set @min_eventgm_lvl,60; // Minimum GM Level Required To "Give Item" and "Give KCP"
  54. set @min_item_amount,1; // Minimum Item Amount
  55. set @max_item_amount,1000; // Maximum Item Amount
  56. set @min_kcp_amount,1; // Minimum KCP Amount
  57. set @max_kcp_amount,10; // Maximum KCP Amount
  58. set @check_online,1; // Check If Target Player Is Online Before Giving Item
  59. set @notify_player,1; // 1 == Yes | 0 == No (Notify Player When GM Gives Them Item)
  60. set @allow_announce,1; // 1 == Yes | 0 == No (Let GM Choose If He/She Wants To Announce)
  61. setarray @announce_loc$, // Possible Announce Locations
  62. "bc_all",
  63. "bc_map",
  64. "bc_area";
  65.  
  66. // Main Script
  67. L_Main:
  68. mes @npc$;
  69. mes " ";
  70. if (getgmlevel() > @min_gm_lvl)
  71. {
  72. mes "Hello GM "+ strcharinfo(0) +".";
  73. mes " ";
  74. mes "What would you like today?";
  75. switch(select("Make Item","Give Item","Give KCP","Player Menu","Nothing"))
  76. {
  77. // Make Item
  78. case 1: goto L_EP_MakeItem; break;
  79.  
  80. // Give Item
  81. case 2: goto L_EP_GiveItem; break;
  82.  
  83. // Give KCP
  84. case 3: goto L_EP_GiveKCP; break;
  85.  
  86. // Player Menu
  87. case 4: goto L_EP_Collect; break;
  88.  
  89. // Nothing
  90. default: close; break;
  91. }
  92. }
  93. else
  94. {
  95. mes "Hello, what would you like today?";
  96. switch(select("Collect Event Prize","Collection Log","Nothing"))
  97. {
  98. // Collect Event Prize
  99. case 1: goto L_EP_Collect; break;
  100.  
  101. // Collection Log
  102. case 2: goto L_EP_CLog; break;
  103.  
  104. // Nothing
  105. default: close; break;
  106. }
  107. }
  108.  
  109. // Make Item [GM]
  110. L_EP_MakeItem:
  111. next;
  112. mes @npc$;
  113. mes " ";
  114. mes "What item would you like?";
  115. mes "Enter the ID.";
  116. input @ep_item_id;
  117. next;
  118. if (getitemname(@ep_item_id) == "" || getitemname(@ep_item_id) == "null")
  119. {
  120. mes @npc$;
  121. mes " ";
  122. mes "^CC0000Sorry, "+ @ep_item_id +" is an invalid item ID.^000000";
  123. close;
  124. }
  125. mes @npc$;
  126. mes " ";
  127. mes "Okay, how many "+ getitemname(@ep_item_id) +" do you want?";
  128. mes " ";
  129. mes "Min "+ @min_item_amount +" and Max "+ @max_item_amount +".";
  130. input @ep_item_count;
  131. next;
  132. if (@ep_item_count < @min_item_amount || @ep_item_count > @max_item_amount)
  133. {
  134. mes @npc$;
  135. mes " ";
  136. mes "^CC0000Sorry, "+ @ep_item_count +" is an invalid amount.";
  137. mes " ";
  138. mes "Min "+ @min_item_amount +" and Max "+ @max_item_amount +".^000000";
  139. close;
  140. }
  141. if (@check_weight && checkweight(@ep_item_id, @ep_item_count) == 0)
  142. {
  143. mes @npc$;
  144. mes " ";
  145. mes "^CC0000Sorry, you cannot hold "+ @ep_item_count +"x "+ getitemname(@ep_item_id) +".";
  146. mes " ";
  147. mes "Your inventory is full.^000000";
  148. close;
  149. }
  150. set @when$,callfunc("makeTimestamp");
  151. set @nb,query_sql("INSERT INTO `itemizer` VALUES(NULL,'"+ escape_sql(@ep_item_id) +"','"+ escape_sql(@ep_item_count) +"','"+ escape_sql(getitemname(@ep_item_id)) +"','"+ escape_sql(getcharid(0)) +"','"+ escape_sql(strcharinfo(0)) +"','N/A','[GM] "+ escape_sql(strcharinfo(0)) +"','"+ escape_sql(@when$) +"','gm','1')");
  152. getitem @ep_item_id,@ep_item_count;
  153. mes @npc$;
  154. mes " ";
  155. mes "All done ~";
  156. close;
  157.  
  158. // Give Item [GM]
  159. L_EP_GiveItem:
  160. next;
  161. mes @npc$;
  162. mes " ";
  163. if (getgmlevel() < @min_eventgm_lvl)
  164. {
  165. mes "^CC0000Access Denied!";
  166. mes " ";
  167. mes "You must be atleast level "+ @min_eventgm_lvl +" GM.^000000";
  168. close;
  169. }
  170. mes "Enter the ID of the Item you would like to give a player.";
  171. mes "^777777( ID range : "+.@item_id_range[0]+" ~ "+.@item_id_range[1]+" )^000000";
  172. mes " ";
  173. mes "E.g. ^0000FFID 512^000000 == ^008000Apple^000000";
  174. input @ep_item_id;
  175. next;
  176. if( @ep_item_id < .@item_id_range[0] || @ep_item_id > .@item_id_range[1] ){
  177. mes "Only item id between "+.@item_id_range[0]+" ~ "+.@item_id_range[1]+" is acceptable.";
  178. close;
  179. }
  180. if (getitemname(@ep_item_id) == "" || getitemname(@ep_item_id) == "null")
  181. {
  182. mes @npc$;
  183. mes " ";
  184. mes "^CC0000Sorry, "+ @ep_item_id +" is an invalid item ID.^000000";
  185. close;
  186. }
  187. mes @npc$;
  188. mes " ";
  189. mes "Okay, how many "+ getitemname(@ep_item_id) +" do you want to give a player?";
  190. mes " ";
  191. mes "Min "+ @min_item_amount +" and Max "+ @max_item_amount +".";
  192. input @ep_item_count;
  193. next;
  194. if (@ep_item_count < @min_item_amount || @ep_item_count > @max_item_amount)
  195. {
  196. mes @npc$;
  197. mes " ";
  198. mes "^CC0000Sorry, "+ @ep_item_count +" is an invalid amount.";
  199. mes " ";
  200. mes "Min "+ @min_item_amount +" and Max "+ @max_item_amount +".^000000";
  201. close;
  202. }
  203. mes @npc$;
  204. mes " ";
  205. mes "Okay, who do you want to give "+ @ep_item_count +"x "+ getitemname(@ep_item_id) +"?";
  206. mes " ";
  207. mes "Enter player name"+ (@check_online ? " (must be online)." : " .");
  208. input @ep_char_name$;
  209. next;
  210. set @ep_char_id,getcharid(0,@ep_char_name$);
  211. if (@check_online && !isloggedin(getcharid(3,@ep_char_name$)))
  212. {
  213. mes @npc$;
  214. mes " ";
  215. mes "^CC0000Sorry, "+ @ep_char_name$ +" is invalid.";
  216. mes " ";
  217. mes "This player either doesn't exist or s/he is not online now.^000000";
  218. close;
  219. }
  220. mes @npc$;
  221. mes " ";
  222. mes "Now, enter the reason for giving "+ @ep_item_count +"x "+ getitemname(@ep_item_id) +" to "+ @ep_char_name$ +".";
  223. input @ep_reason$;
  224. next;
  225. if (@ep_reason$ == "")
  226. {
  227. mes @npc$;
  228. mes " ";
  229. mes "^CC0000Sorry, that is not a valid reason.^000000";
  230. close;
  231. }
  232. if (@allow_announce)
  233. {
  234. mes @npc$;
  235. mes " ";
  236. mes "Do you want to announce the following message?";
  237. mes " ";
  238. set @anounce_msg$,"[GM] "+ strcharinfo(0) +" Gave "+ @ep_item_count +"x "+ getitemname(@ep_item_id) +" to "+ @ep_char_name$ +". Reason - "+ @ep_reason$;
  239. mes @anounce_msg$;
  240. if (select("Yes:No") == 1) { set @do_announce,1; } else { set @do_announce,0; }
  241. next;
  242. if (@do_announce)
  243. {
  244. mes @npc$;
  245. mes " ";
  246. mes "Where would you like to announce this message?";
  247. mes " ";
  248. mes @anounce_msg$;
  249. set @options$,"";
  250. for (set @i,0; @i < getarraysize(@announce_loc$); set @i,@i+1)
  251. {
  252. if (@announce_loc$[@i] == "bc_all") {
  253. set @options$,@options$+"Server Wide";
  254. } else if (@announce_loc$[@i] == "bc_map") {
  255. set @options$,@options$+"Everyone In The Same Map";
  256. } else if (@announce_loc$[@i] == "bc_area") {
  257. set @options$,@options$+"Everyone Near You";
  258. }
  259. if (@i != (getarraysize(@announce_loc$) - 1)) { set @options$,@options$+":"; }
  260. }
  261. set @choice,select(@options$);
  262. set @a_loc$,@announce_loc$[@choice];
  263. next;
  264. mes @npc$;
  265. mes " ";
  266. mes "What color do you want to announce in?";
  267. if (select("Yello:Blue") == 1) { set @a_color$,"bc_yellow"; } else { set @a_color$,"bc_blue"; }
  268. next;
  269. }
  270. }
  271. mes @npc$;
  272. mes " ";
  273. mes "Is this correct?";
  274. mes " ";
  275. mes "Give ^0000FF"+ @ep_item_count +"x^000000 ^008000"+ getitemname(@ep_item_id) +"^000000 to ^CC0000"+ @ep_char_name$ +"^000000.";
  276. mes " ";
  277. mes "Reason : "+ @ep_reason$;
  278. if (select("Yes:No") == 1)
  279. {
  280. next;
  281. set @when$,callfunc("makeTimestamp");
  282. set @nb,query_sql("INSERT INTO `itemizer` VALUES(NULL,'"+ escape_sql(@ep_item_id) +"','"+ escape_sql(@ep_item_count) +"','"+ escape_sql(getitemname(@ep_item_id)) +"','"+ escape_sql(@ep_char_id) +"','"+ escape_sql(@ep_char_name$) +"','"+ escape_sql(@ep_reason$) +"','[GM] "+ escape_sql(strcharinfo(0)) +"','"+ escape_sql(@when$) +"','player','0')");
  283. mes @npc$;
  284. mes " ";
  285. mes "All Done~";
  286. close2;
  287. if (@notify_player) { message @ep_char_name$,"[GM] "+ strcharinfo(0) +" Has Given You "+ @ep_item_count +"x "+ getitemname(@ep_item_id) +"."; }
  288. if (@do_announce)
  289. {
  290. if (@a_color$ == "bc_yellow")
  291. {
  292. if (@a_loc$ == "bc_all") {
  293. announce @anounce_msg$,bc_yellow|bc_all;
  294. } else if (@a_loc$ == "bc_map") {
  295. announce @anounce_msg$,bc_yellow|bc_map;
  296. } else {
  297. announce @anounce_msg$,bc_yellow|bc_area;
  298. }
  299. }
  300. else
  301. {
  302. if (@a_loc$ == "bc_all") {
  303. announce @anounce_msg$,bc_blue|bc_all;
  304. } else if (@a_loc$ == "bc_map") {
  305. announce @anounce_msg$,bc_blue|bc_map;
  306. } else {
  307. announce @anounce_msg$,bc_blue|bc_area;
  308. }
  309. }
  310. }
  311. end;
  312. }
  313. close;
  314.  
  315. // Give KCP [GM]
  316. L_EP_GiveKCP:
  317. next;
  318. mes @npc$;
  319. mes " ";
  320. if (getgmlevel() < @min_eventgm_lvl)
  321. {
  322. mes "^CC0000Access Denied!";
  323. mes " ";
  324. mes "You must be atleast level "+ @min_eventgm_lvl +" GM.^000000";
  325. close;
  326. }
  327. mes "Okay, how many KCP would you like to give?";
  328. mes " ";
  329. mes "Min "+ @min_kcp_amount +" and Max "+ @max_kcp_amount +".";
  330. input @ep_kcp_count;
  331. next;
  332. if (@ep_kcp_count < @min_kcp_amount || @ep_kcp_count > @max_kcp_amount)
  333. {
  334. mes @npc$;
  335. mes " ";
  336. mes "^CC0000Sorry, "+ @ep_kcp_count +" is an invalid amount.";
  337. mes " ";
  338. mes "Min "+ @min_kcp_amount +" and Max "+ @max_kcp_amount +".^000000";
  339. close;
  340. }
  341. mes @npc$;
  342. mes " ";
  343. mes "Okay, who do you want to give "+ @ep_kcp_count +" KCP?";
  344. mes " ";
  345. mes "Enter player name"+ (@check_online ? " (must be online)." : " .");
  346. input @ep_char_name$;
  347. next;
  348. set @ep_char_id,getcharid(0,@ep_char_name$);
  349. if (@check_online && !isloggedin(getcharid(3,@ep_char_name$)))
  350. {
  351. mes @npc$;
  352. mes " ";
  353. mes "^CC0000Sorry, "+ @ep_char_name$ +" is invalid.";
  354. mes " ";
  355. mes "This player either doesn't exist or s/he is not online now.^000000";
  356. close;
  357. }
  358. mes @npc$;
  359. mes " ";
  360. mes "Now, enter the reason for giving "+ @ep_kcp_count +" KCP to "+ @ep_char_name$ +".";
  361. input @ep_reason$;
  362. next;
  363. if (@ep_reason$ == "")
  364. {
  365. mes @npc$;
  366. mes " ";
  367. mes "^CC0000Sorry, that is not a valid reason.^000000";
  368. close;
  369. }
  370. if (@allow_announce)
  371. {
  372. mes @npc$;
  373. mes " ";
  374. mes "Do you want to announce the following message?";
  375. mes " ";
  376. set @anounce_msg$,"[GM] "+ strcharinfo(0) +" Gave "+ @ep_kcp_count +"x Kafra Credit Point (KCP) to "+ @ep_char_name$ +". Reason - "+ @ep_reason$;
  377. mes @anounce_msg$;
  378. if (select("Yes:No") == 1) { set @do_announce,1; } else { set @do_announce,0; }
  379. next;
  380. if (@do_announce)
  381. {
  382. mes @npc$;
  383. mes " ";
  384. mes "Where would you like to announce this message?";
  385. mes " ";
  386. mes @anounce_msg$;
  387. set @options$,"";
  388. for (set @i,0; @i < getarraysize(@announce_loc$); set @i,@i+1)
  389. {
  390. if (@announce_loc$[@i] == "bc_all") {
  391. set @options$,@options$+"Server Wide";
  392. } else if (@announce_loc$[@i] == "bc_map") {
  393. set @options$,@options$+"Everyone In The Same Map";
  394. } else if (@announce_loc$[@i] == "bc_area") {
  395. set @options$,@options$+"Everyone Near You";
  396. }
  397. if (@i != (getarraysize(@announce_loc$) - 1)) { set @options$,@options$+":"; }
  398. }
  399. set @choice,select(@options$);
  400. set @a_loc$,@announce_loc$[@choice];
  401. next;
  402. mes @npc$;
  403. mes " ";
  404. mes "What color do you want to announce in?";
  405. if (select("Yello:Blue") == 1) { set @a_color$,"bc_yellow"; } else { set @a_color$,"bc_blue"; }
  406. next;
  407. }
  408. }
  409. mes @npc$;
  410. mes " ";
  411. mes "Is this correct?";
  412. mes " ";
  413. mes "Give ^0000FF"+ @ep_kcp_count +"^000000 ^008000KCP^000000 to ^CC0000"+ @ep_char_name$ +"^000000.";
  414. mes " ";
  415. mes "Reason : "+ @ep_reason$;
  416. if (select("Yes:No") == 1)
  417. {
  418. next;
  419. set @when,callfunc("makeTimestamp");
  420. set @nb,query_sql("INSERT INTO `itemizer` VALUES(NULL,'"+ @dummy_kcp_id +"','"+ @ep_kcp_count +"','Kafra Credit Point (KCP)','"+ @ep_char_id +"','"+ @ep_char_name$ +"','"+ @ep_reason$ +"','[GM] "+ strcharinfo(0) +"','"+ @when +"','player','0')");
  421. mes @npc$;
  422. mes " ";
  423. mes "All Done~";
  424. close2;
  425. if (@notify_player) { message @ep_char_name$,"[GM] "+ strcharinfo(0) +" Has Given You "+ @ep_kcp_count +" Kafra Credit Point (KCP)."; }
  426. if (@do_announce)
  427. {
  428. if (@a_color$ == "bc_yellow")
  429. {
  430. if (@a_loc$ == "bc_all") {
  431. announce @anounce_msg$,bc_yellow|bc_all;
  432. } else if (@a_loc$ == "bc_map") {
  433. announce @anounce_msg$,bc_yellow|bc_map;
  434. } else {
  435. announce @anounce_msg$,bc_yellow|bc_area;
  436. }
  437. }
  438. else
  439. {
  440. if (@a_loc$ == "bc_all") {
  441. announce @anounce_msg$,bc_blue|bc_all;
  442. } else if (@a_loc$ == "bc_map") {
  443. announce @anounce_msg$,bc_blue|bc_map;
  444. } else {
  445. announce @anounce_msg$,bc_blue|bc_area;
  446. }
  447. }
  448. }
  449. end;
  450. }
  451. close;
  452.  
  453. // Collect Event Prize (Part 1) [Player]
  454. L_EP_Collect:
  455. next;
  456. mes @npc$;
  457. mes " ";
  458. mes "Would you like to check if any item is waiting to be collected?";
  459. if (select("Yes Please:No Thanks") == 1)
  460. {
  461. next;
  462. if (getarraysize(@db_id))
  463. {
  464. deletearray @db_id,127;
  465. deletearray @item_id,127;
  466. deletearray @item_name$,127;
  467. deletearray @item_amount,127;
  468. deletearray @reason$,127;
  469. deletearray @by_gm$,127;
  470. }
  471. set @result,query_sql("SELECT `id`,`item_id`,`item_name`,`item_amount`,`reason`,`by_gm` FROM `itemizer` WHERE (`char_id` = '"+ getcharid(0) +"' AND `for` = 'player' AND `collected` = 0) LIMIT 127",
  472. @db_id,
  473. @item_id,
  474. @item_name$,
  475. @item_amount,
  476. @reason$,
  477. @by_gm$);
  478. if (!@result)
  479. {
  480. mes @npc$;
  481. mes " ";
  482. mes "^CC0000No items are waiting to be collected by you.^000000";
  483. close;
  484. }
  485. else
  486. {
  487. goto L_EP_C_Final;
  488. }
  489. }
  490. close;
  491.  
  492. // Collect Event Prize (Part 2) [Player]
  493. L_EP_C_Final:
  494. set @options$,"";
  495. for (set @i,0; @i < @result; set @i,@i+1)
  496. {
  497. set @options$,@options$+@item_amount[@i] +"x "+@item_name$[@i]+":";
  498. }
  499. mes @npc$;
  500. mes " ";
  501. mes "Here is a list of item(s) waiting to be collected by you.";
  502. mes " ";
  503. mes "Pick the item you want to collect now.";
  504. set @choice,select(@options$) - 1;
  505. next;
  506. mes @npc$;
  507. mes " ";
  508. if (@item_id[@choice] != @dummy_kcp_id) { mes "ID - "+ @item_id[@choice]; }
  509. mes "Name - "+ @item_name$[@choice];
  510. mes "Amount - "+ @item_amount[@choice] +"x";
  511. mes "By - "+ @by_gm$[@choice];
  512. mes " ";
  513. mes "Reason - "+ @reason$[@choice];
  514. if (select("Collect Now:Collect Later") == 1)
  515. {
  516. next;
  517. if (@item_id[@choice] != @dummy_kcp_id)
  518. {
  519. if (@check_weight && checkweight(@item_id[@choice], @item_amount[@choice]) == 0)
  520. {
  521. mes @npc$;
  522. mes " ";
  523. mes "^CC0000Sorry, you cannot hold "+ @item_amount[@choice] +"x "+ @item_name$[@choice] +".";
  524. mes " ";
  525. mes "Your inventory is full.^000000";
  526. close;
  527. }
  528. }
  529. set @nb,query_sql("UPDATE `itemizer` SET `collected` = 1 WHERE (`id` = '"+ @db_id[@choice] +"') LIMIT 1");
  530. if (@item_id[@choice] != @dummy_kcp_id)
  531. {
  532. getitem @item_id[@choice],@item_amount[@choice];
  533. }
  534. else
  535. {
  536. set #CASHPOINTS,(#CASHPOINTS + @item_amount[@choice]);
  537. }
  538. set @result,(@result - 1);
  539. deletearray @db_id[@choice],1;
  540. deletearray @item_id[@choice],1;
  541. deletearray @item_name$[@choice],1;
  542. deletearray @item_amount[@choice],1;
  543. deletearray @reason$[@choice],1;
  544. deletearray @by_gm$[@choice],1;
  545. goto L_EP_C_Final;
  546. }
  547. else
  548. {
  549. next;
  550. goto L_EP_C_Final;
  551. }
  552.  
  553. // Collection Log [Player]
  554. L_EP_CLog:
  555. next;
  556. mes @npc$;
  557. mes " ";
  558. if (getarraysize(@item_name$))
  559. {
  560. deletearray @item_name$,127;
  561. deletearray @item_amount,127;
  562. deletearray @reason$,127;
  563. deletearray @by_gm$,127;
  564. deletearray @when$,127;
  565. }
  566. if (!@offset){ set @offset,0; }
  567. if (!@rows_per_page) { set @rows_per_page,10; }
  568. set @result,query_sql("SELECT `item_name`,`item_amount`,`reason`,`by_gm`,`when` FROM `itemizer` WHERE (`char_id` = '"+ getcharid(0) +"' AND `for` = 'player' AND `collected` = 1) ORDER BY `when` DESC LIMIT "+ @offset +","+ @rows_per_page,
  569. @item_name$,
  570. @item_amount,
  571. @reason$,
  572. @by_gm$,
  573. @when$);
  574. if(!@result)
  575. {
  576. if (@offset == 10) {
  577. mes "^CC0000You have not collected any items from me yet.^000000";
  578. } else {
  579. mes "^CC0000Sorry, there is no more data.^000000";
  580. }
  581. close2;
  582. if (@offset) { set @offset,0; }
  583. end;
  584. }
  585. else
  586. {
  587. for (set @i,0; @i < @result; set @i,@i+1)
  588. {
  589. mes "^0000FF"+ @item_amount[@i] +"x^000000 ^008000"+ @item_name$[@i] +"^000000";
  590. mes "Reason - "+ @reason$[@i];
  591. mes "By - "+ @by_gm$[@i];
  592. mes "When - "+ @when$[@i];
  593. if (@i != (@result - 1)) { mes " "; }
  594. }
  595. set @offset,(@offset + @rows_per_page);
  596. if (select("Next "+ @rows_per_page +" Logs:Cancel") == 2)
  597. {
  598. close2;
  599. if (@offset) { set @offset,0; }
  600. end;
  601. }
  602. goto L_EP_CLog;
  603. }
  604.  
  605. }
  606.  
  607. //
  608. // Func To Make MySQL Friendly Timestamp
  609. //
  610. function script makeTimestamp {
  611.  
  612. // Get Current Date & Time Variables
  613. set @curYear,gettime(7);
  614. set @curMonth,gettime(6);
  615. set @curDay,gettime(5);
  616. set @curHour,gettime(3);
  617. set @curMinute,gettime(2);
  618. set @curSecond,gettime(1);
  619.  
  620. // Start A New Timestamp Variable
  621. set @timestamp$,"";
  622.  
  623. // MySQL Timestamp Friendly :: Year
  624. set @timestamp$,@timestamp$+@curYear+"-";
  625.  
  626. // MySQL Timestamp Friendly :: Month
  627. if (@curMonth <= 9) {
  628. set @timestamp$,@timestamp$+"0"+@curMonth+"-";
  629. } else {
  630. set @timestamp$,@timestamp$+@curMonth+"-";
  631. }
  632.  
  633. // MySQL Timestamp Friendly :: Day
  634. if (@curDay <= 9) {
  635. set @timestamp$,@timestamp$+"0"+@curDay+" ";
  636. } else {
  637. set @timestamp$,@timestamp$+@curDay+" ";
  638. }
  639.  
  640. // MySQL Timestamp Friendly :: Hour
  641. if (@curHour <= 9) {
  642. set @timestamp$,@timestamp$+"0"+@curHour+":";
  643. } else {
  644. set @timestamp$,@timestamp$+@curHour+":";
  645. }
  646.  
  647. // MySQL Timestamp Friendly :: Minute
  648. if (@curMinute <= 9) {
  649. set @timestamp$,@timestamp$+"0"+@curMinute+":";
  650. } else {
  651. set @timestamp$,@timestamp$+@curMinute+":";
  652. }
  653.  
  654. // MySQL Timestamp Friendly :: Second
  655. if (@curSecond <= 9) {
  656. set @timestamp$,@timestamp$+"0"+@curSecond;
  657. } else {
  658. set @timestamp$,@timestamp$+@curSecond;
  659. }
  660.  
  661. // Return MySQL Friendly Timestamp
  662. return @timestamp$;
  663.  
  664. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement