Advertisement
KingOfVC

jail

Oct 3rd, 2014
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. /*
  2. jail functions by KingOfVC
  3. */
  4.  
  5. // jail
  6. function jail ( player )
  7. {
  8. if (PlayerWanted(player) == 1) MessagePlayer(" momoek",player);
  9. else
  10. {
  11. status[ player.ID ].Jailed = true;
  12. player.Pos = Vector ( 388.680, -509.527, 8.415 )
  13. QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
  14. QuerySQL( db,"UPDATE Jail SET time='20000' WHERE Name='" + player.Name +"'");
  15. NewTimer( "unjail", 20000 ,1,player.ID );
  16. }
  17. if(PlayerWanted(player) == 2)
  18. {
  19. status[ player.ID ].Jailed = true;
  20. Player.Pos = Vector ( 388.680, -509.527, 8.415 )
  21. QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
  22. QuerySQL( db,"UPDATE Jail SET time='40000' WHERE Name='" + player.Name +"'");
  23. NewTimer( "unjail", 40000 ,0 );
  24. }
  25. if(PlayerWanted(player) == 3)
  26. {
  27. status[ player.ID ].Jailed = true;
  28. Player.Pos = Vector ( 388.680, -509.527, 8.415 )
  29. QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
  30. QuerySQL( db,"UPDATE Jail SET time='60000' WHERE Name='" + player.Name +"'");
  31. NewTimer( "unjail", 60000 ,0 );
  32. }
  33. if(PlayerWanted(player) == 4)
  34. {
  35. status[ player.ID ].Jailed = true;
  36. Player.Pos = Vector ( 388.680, -509.527, 8.415 )
  37. QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
  38. QuerySQL( db,"UPDATE Jail SET time='80000' WHERE Name='" + player.Name +"'");
  39. NewTimer( "unjail", 80000 ,0 );
  40. }
  41. if(PlayerWanted(player) == 5)
  42. {
  43. status[ player.ID ].Jailed = true;
  44. Player.Pos = Vector ( 388.680, -509.527, 8.415 )
  45. QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
  46. QuerySQL( db,"UPDATE Jail SET time='100000' WHERE Name='" + player.Name +"'");
  47. NewTimer( "unjail", 100000 ,0 );
  48. }
  49. if(PlayerWanted(player) == 6)
  50. {
  51. status[ player.ID ].Jailed = true;
  52. Player.Pos = Vector ( 388.680, -509.527, 8.415 )
  53. QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
  54. QuerySQL( db,"UPDATE Jail SET time='120000' WHERE Name='" + player.Name +"'");
  55. NewTimer( "unjail", 120000 ,0 );
  56. }
  57. if(PlayerWanted(player).tointeger() > 6)
  58. {
  59. status[ player.ID ].Jailed = true;
  60. Player.Pos = Vector ( 388.680, -509.527, 8.415 )
  61. QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
  62. QuerySQL( db,"UPDATE Jail SET time='140000' WHERE Name='" + player.Name +"'");
  63. NewTimer( "unjail", 140000 ,0 );
  64. }
  65. }
  66.  
  67.  
  68.  
  69. // unjail him
  70. function unjail ( player )
  71. {
  72. status[ player.ID ].Jailed = false;
  73. QuerySQL( db,"UPDATE Jail SET Jailed='no' WHERE Name='" + plr.Name +"'");
  74. QuerySQL( db,"UPDATE Jail SET time='0' WHERE Name='" + plr.Name +"'");
  75. QuerySQL( db,"UPDATE Jail SET wanted='0' WHERE Name='" + plr.Name +"'");
  76. MessagePlayer ( "Free ",plr );
  77. }
  78.  
  79. // check his wanted level
  80. function PlayerWanted( player )
  81. {
  82. local name = player.Name;
  83. local Answer = QuerySQL( db, "SELECT wanted FROM Jail WHERE Name='" + player.Name +"' COLLATE NOCASE" );
  84. local Wanted = GetSQLColumnData( Answer, 0 );
  85. return Wanted;
  86. FreeSQLQuery( Answer );
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement