Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- jail functions by KingOfVC
- */
- // jail
- function jail ( player )
- {
- if (PlayerWanted(player) == 1) MessagePlayer(" momoek",player);
- else
- {
- status[ player.ID ].Jailed = true;
- player.Pos = Vector ( 388.680, -509.527, 8.415 )
- QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
- QuerySQL( db,"UPDATE Jail SET time='20000' WHERE Name='" + player.Name +"'");
- NewTimer( "unjail", 20000 ,1,player.ID );
- }
- if(PlayerWanted(player) == 2)
- {
- status[ player.ID ].Jailed = true;
- Player.Pos = Vector ( 388.680, -509.527, 8.415 )
- QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
- QuerySQL( db,"UPDATE Jail SET time='40000' WHERE Name='" + player.Name +"'");
- NewTimer( "unjail", 40000 ,0 );
- }
- if(PlayerWanted(player) == 3)
- {
- status[ player.ID ].Jailed = true;
- Player.Pos = Vector ( 388.680, -509.527, 8.415 )
- QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
- QuerySQL( db,"UPDATE Jail SET time='60000' WHERE Name='" + player.Name +"'");
- NewTimer( "unjail", 60000 ,0 );
- }
- if(PlayerWanted(player) == 4)
- {
- status[ player.ID ].Jailed = true;
- Player.Pos = Vector ( 388.680, -509.527, 8.415 )
- QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
- QuerySQL( db,"UPDATE Jail SET time='80000' WHERE Name='" + player.Name +"'");
- NewTimer( "unjail", 80000 ,0 );
- }
- if(PlayerWanted(player) == 5)
- {
- status[ player.ID ].Jailed = true;
- Player.Pos = Vector ( 388.680, -509.527, 8.415 )
- QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
- QuerySQL( db,"UPDATE Jail SET time='100000' WHERE Name='" + player.Name +"'");
- NewTimer( "unjail", 100000 ,0 );
- }
- if(PlayerWanted(player) == 6)
- {
- status[ player.ID ].Jailed = true;
- Player.Pos = Vector ( 388.680, -509.527, 8.415 )
- QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
- QuerySQL( db,"UPDATE Jail SET time='120000' WHERE Name='" + player.Name +"'");
- NewTimer( "unjail", 120000 ,0 );
- }
- if(PlayerWanted(player).tointeger() > 6)
- {
- status[ player.ID ].Jailed = true;
- Player.Pos = Vector ( 388.680, -509.527, 8.415 )
- QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + player.Name +"'");
- QuerySQL( db,"UPDATE Jail SET time='140000' WHERE Name='" + player.Name +"'");
- NewTimer( "unjail", 140000 ,0 );
- }
- }
- // unjail him
- function unjail ( player )
- {
- status[ player.ID ].Jailed = false;
- QuerySQL( db,"UPDATE Jail SET Jailed='no' WHERE Name='" + plr.Name +"'");
- QuerySQL( db,"UPDATE Jail SET time='0' WHERE Name='" + plr.Name +"'");
- QuerySQL( db,"UPDATE Jail SET wanted='0' WHERE Name='" + plr.Name +"'");
- MessagePlayer ( "Free ",plr );
- }
- // check his wanted level
- function PlayerWanted( player )
- {
- local name = player.Name;
- local Answer = QuerySQL( db, "SELECT wanted FROM Jail WHERE Name='" + player.Name +"' COLLATE NOCASE" );
- local Wanted = GetSQLColumnData( Answer, 0 );
- return Wanted;
- FreeSQLQuery( Answer );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement