MuhammadZeeshan

asdf asfas fas f

Dec 5th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. QuerySQL(db, "CREATE TABLE IF NOT EXISTS VIP(Name TEXT, Time NUMERIC DEFAULT 0, TimeExp NUMERIC DEFAULT 0 ) );
  2.  
  3.  
  4. VIP = false;
  5. VIPExp = 0;
  6.  
  7.  
  8. else if ( cmd == "buyvip")
  9. {
  10. if ( status[ player.ID ].Registered == false ) ErrorMessage( "[#FFFFFF]You need to be a part of our community to use this command.", player );
  11. else if ( status[ player.ID ].Logged == false ) ErrorMessage( "[#FFFFFF]You need to be identified to use this command.", player );
  12. else if ( !text ) ErrorMessage( "Syntax: /" + cmd + " <days>", player );
  13. else if ( IsNoob( player, cmd ) ) return 0;
  14. else
  15. {
  16. local duration = duration(GetTok( text, " ", 1));
  17. if (!duration) ErrorMessage( "Syntax: /" + cmd + " <days>", player );
  18. else
  19. {
  20. VIP( player, duration);
  21. }
  22. }
  23. }
  24.  
  25.  
  26.  
  27.  
  28. function VIP( player, duration )
  29. {
  30. local g_time, duration_type;
  31. switch( duration.len() )
  32. {
  33. case 2: //this is for slicing the type of 1d
  34. g_time = duration.slice(0,1);
  35. duration_type = duration.slice(1,2);
  36. break;
  37.  
  38. case 3: //this is for slicing the type of 10d,10h,10m
  39. g_time = duration.slice(0,2);
  40. duration_type = duration.slice(2,3);
  41. break;
  42. }
  43. default:
  44. ErrorMessage( "Invalid Duration", player );
  45. {
  46. local g_time_, g_duration_type_;
  47. switch( duration_type )
  48. {
  49. case "d":
  50. g_time_ = g_timeexp.tointeger() * 86400;
  51. g_duration_type_ = "day(s)";
  52. break;
  53.  
  54. default:
  55. SendMessage( "Invalid format, the format you typed is wrong", player );
  56. }
  57. local dur = g_time + " " + g_duration_type_;
  58. SendMessage( "[VIP] - You have purchased the vip pack for " + dur + ".", player );
  59. QuerySQL(db, "INSERT INTO VIP ( Name, Time, TimeExp ) VALUES ( '"+player.Name+"', '"+time()+"', '"+g_timeexp_+"'" );
  60. }
  61. }
Add Comment
Please, Sign In to add comment