Advertisement
KingOfVC

jail

Nov 2nd, 2014
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. function jail ( id )
  2. {
  3. local plr = GetPlayer ( id );
  4. if ( plr )
  5. {
  6. local jailtime = PlayerWanted( plr ).tointeger()* 20;
  7. status[ plr.ID ].Jailed = true;
  8. plr.Pos = Vector ( 388.680, -509.527, 8.415 )
  9. QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + plr.Name +"'");
  10. QuerySQL( db,"UPDATE Jail SET time='" + jailtime + "' WHERE Name='" + plr.Name +"'");
  11. NewTimer( "unjail",jailtime ,1,plr.ID );
  12. MessagePlayer("You have been jailed for " + jailtime.tointeger(), plr );
  13. }
  14. }
  15. function unjail ( id )
  16. {
  17. local plr = GetPlayer ( id );
  18. if ( plr )
  19. {
  20. StaffMessage("[UNJAIL] UnJail");
  21. print("[UNJAIL] UnJail");
  22. status[ plr.ID ].Jailed = false;
  23. QuerySQL( db,"UPDATE Jail SET Jailed='no' WHERE Name='" + plr.Name +"'");
  24. QuerySQL( db,"UPDATE Jail SET time='0' WHERE Name='" + plr.Name +"'");
  25. QuerySQL( db,"UPDATE Jail SET wanted='0' WHERE Name='" + plr.Name +"'");
  26. plr.Pos = Vector ( 397.718, -471.137, 11.7534 )
  27. MessagePlayer ( "Free ",plr );
  28. }
  29. }
  30. function PlayerWanted( player )
  31. {
  32. local id = player.Name;
  33. local Answer = QuerySQL( db, "SELECT wanted FROM Jail WHERE Name='" + player.Name +"' COLLATE NOCASE" );
  34. local Wanted = GetSQLColumnData( Answer, 0 );
  35. return Wanted;
  36. FreeSQLQuery( Answer );
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement