Advertisement
Guest User

Untitled

a guest
Apr 20th, 2017
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. /*
  2. CREATE TABLE IF NOT EXISTS `guildpack` (
  3. `id` int(11) NOT NULL auto_increment,
  4. `account_id` int(11) NOT NULL default '0',
  5. `name` varchar(23) NOT NULL default '',
  6. `last_ip` varchar(100) NOT NULL default '',
  7. PRIMARY KEY (`account_id`),
  8. KEY (`id`)
  9. ) ENGINE=MyISAM;
  10. */
  11. //============================================================
  12.  
  13. amatsu,232,216,3 script Unique ID Recorder 4_F_TELEPORTER,{
  14.  
  15. .@name$ = "[^FF8000" + strnpcinfo(NPC_NAME) + "^000000]";
  16.  
  17. mes .@name$;
  18. mes "Would you like to check";
  19. mes "if your IP Address has";
  20. mes "been recorded by me?";
  21. next;
  22. if (select(
  23. "^777777Truncate Table.^000000",
  24. "^FF0000Check recorded information.^000000"
  25. ) == 1)
  26. {
  27. mes .@name$;
  28. mes "This action will truncate";
  29. mes "the guildpack table, clearing";
  30. mes "all of its contents.";
  31. next;
  32.  
  33. query_sql("TRUNCATE TABLE `guildpack`");
  34.  
  35. mes .@name$;
  36. mes "Done. Check your recorded";
  37. mes "information to confirm";
  38. mes "action.";
  39. close;
  40. }
  41.  
  42. .@myip$ = getcharip();
  43. if (callsub(S_Check_IP))
  44. {
  45. mes .@name$;
  46. mes("^616D7EIt seems I have already recorded your IP Address: ^ff0000" + .@myip$ + "^000000.");
  47. close;
  48. }
  49. query_sql("INSERT INTO `guildpack` VALUES (NULL," + getcharid(CHAR_ID_ACCOUNT) + ",'" + escape_sql(strcharinfo(PC_NAME)) + "','" + .@myip$ + "','" + .@uid$ + "')");
  50.  
  51. mes .@name$;
  52. mes "This is the first time I have recorded your information.";
  53. close;
  54.  
  55. // Checks IP Address
  56. S_Check_IP:
  57. return query_sql("SELECT 1 FROM `guildpack` join login on login.`last_ip` = `guildpack`.`last_ip` where login.account_id = "+ getcharid(CHAR_ID_ACCOUNT), .@tmp);
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement