Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function jail ( id )
- {
- local plr = GetPlayer ( id );
- if ( plr )
- {
- local jailtime = PlayerWanted( plr ).tointeger()* 20;
- status[ plr.ID ].Jailed = true;
- plr.Pos = Vector ( 388.680, -509.527, 8.415 )
- QuerySQL( db,"UPDATE Jail SET Jailed='yes' WHERE Name='" + plr.Name +"'");
- QuerySQL( db,"UPDATE Jail SET time='" + jailtime + "' WHERE Name='" + plr.Name +"'");
- NewTimer( "unjail",jailtime ,1,plr.ID );
- MessagePlayer("You have been jailed for " + jailtime.tointeger(), plr );
- }
- }
- function unjail ( id )
- {
- local plr = GetPlayer ( id );
- if ( plr )
- {
- StaffMessage("[UNJAIL] UnJail");
- print("[UNJAIL] UnJail");
- status[ plr.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 +"'");
- plr.Pos = Vector ( 397.718, -471.137, 11.7534 )
- MessagePlayer ( "Free ",plr );
- }
- }
- function PlayerWanted( player )
- {
- local id = 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