Advertisement
Guest User

Untitled

a guest
Nov 16th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. //=========================================
  2. // VipAdmin v1.3a - requirements:
  3. // - AM VipLib v1.2b
  4. // Desenvolvido por Rafael Perrella
  5. //=========================================
  6.  
  7. prontera,147,174,4 script VIP Administrator#RP 833,{
  8. doevent "#vipadmin::OnWhisperGlobal";
  9. }
  10.  
  11. - script #vipadmin -1,{
  12. OnWhisperGlobal:
  13.  
  14. // Unidades para digitar o tempo VIP
  15. set .@UnitMenu$, "Months (30 days):Days:Hours:Minutes:Seconds:No one.";
  16. setarray .@UnitFactor, 30*86400, 86400, 3600, 60, 1, 0;
  17.  
  18. mes "[^FF0000VipAdmin^000000]";
  19. if (getgmlevel () < 99)
  20. {
  21. mes "Wanna see your credits? :)";
  22. mes "Account number: ^FF0000" + (getcharid (3) - 2000000) + "^000000";
  23. callfunc ("vip_list_time");
  24. close;
  25. }
  26. mes "Input the username.";
  27. input .@username$;
  28. query_sql "SELECT `account_id` FROM `login` WHERE `userid`='" + escape_sql (.@username$) + "'", .@aid;
  29. if (!.@aid)
  30. {
  31. mes "This username doesn't exist.";
  32. close;
  33. }
  34.  
  35. while (.@choice != 5)
  36. {
  37. next;
  38. set .@type, 0;
  39. mes "[^FF0000VipAdmin^000000]";
  40. mes "ID: ^FF8000" + .@aid + "^000000";
  41. mes "Number: ^FF8000" + (.@aid - 2000000) + "^000000";
  42. mes "Username: ^FF8000" + .@username$ + "^000000";
  43. if (!callfunc ("vip_list_time", .@aid))
  44. setd "$AM_Vip" + .@aid, 0;
  45. next;
  46. set .@choice, select ("Clear VIP", "Add VIP time", "Remove VIP time", "Set VIP time", "Exit");
  47. mes "[^FF0000VipAdmin^000000]";
  48. switch (.@choice)
  49. {
  50. case 1:
  51. mes "The user will lose all his VIP.";
  52. mes "Are you sure you want to do this?";
  53. if (select ("No, I don't want to clear his VIP.", "Yes, clear it!!") == 2)
  54. callfunc ("vip_clear", .@aid);
  55. break;
  56.  
  57. case 3:
  58. mes "Remove from the total time, or from a specific level?";
  59. set .@type, select ("Total time.", "Specific level.");
  60. set .@level, 0;
  61. case 2:
  62. case 4:
  63. mes "In what unity you want to input the VIP time?";
  64. if (!.@UnitFactor[select (.@UnitMenu$) - 1])
  65. break;
  66. mes "Input the amount";
  67. input .@time;
  68. if (.@type != 1)
  69. {
  70. mes "Input the VIP level.";
  71. input .@level;
  72. }
  73. setarray .@func$, "vip_add", "vip_remove", "vip_set";
  74. callfunc (.@func$[.@choice - 2], .@time * .@UnitFactor[@menu - 1], .@level, .@aid);
  75. break;
  76. }
  77. }
  78. mes "Have a nice day ^^.";
  79. close;
  80. }
  81.  
  82. // vip_list_time ([uid])
  83. // [18/10] - bug fixed: name changed from vip_listTime to vip_list_time (thanks to uDe)
  84. function script vip_list_time {
  85. set .@aid, getarg (0, getcharid (3));
  86.  
  87. // Exibe tempo total
  88. set .@time, callfunc ("vip_read", 0, .@aid);
  89. mes "Total: " + callfunc ("vipm_format_time", .@time);
  90.  
  91. // Exibe tempos parciais (para cada nível)
  92. for (set .@i, callfunc ("vip_listgroupid", .@aid) - 1; .@i >= 0; set .@i, .@i - 1)
  93. {
  94. set .@levelTime, getd ("$AM_Vip" + .@aid + "[" + @AM_VipLevel[.@i] + "]");
  95. mes "Level ^FF8000" + @AM_VipLevel[.@i] + "^000000 [" + callfunc ("vipm_format_time", .@levelTime) + "]";
  96. }
  97. return .@time;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement