MuhammadZeeshan

asfaafg sgsdf g dfgh dfh d

Dec 22nd, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. else if ( cmd == "tempban" )
  2. {
  3. if ( GetLevel(player) < 5 ) MessagePlayer (" [#4682B4][Error][#FFFFFF]You must need atleast level 5 to access the command",player );
  4. else if( !text ) MessagePlayer("[#4682B4][Syntax][#FFFFFF]/tempban <player> <day:hour:min> <reason>", player);
  5. else
  6. {
  7. local args = split( text, " " );
  8. local plr = GetPlayer(args[0]), expire = args[1], reason = GetTok( text, " ", 3, NumTok( text, " " ) );
  9. if (!expire) MessagePlayer( "Syntax: /" + cmd + " <playername> <day:hour:min> <Reason> ", player );
  10. else if(!reason) MessagePlayer( "Syntax: /" + cmd + " <playername> <day:hour:min> <Reason> ", player );
  11. else
  12. {
  13. if ( plr ) AddBan( player.Name, plr.Name, expire, reason, ip, uid, "on" );
  14. else
  15. {
  16. plr = args[0];
  17. local check = QuerySQL( db, "SELECT * FROM Banned WHERE Name='" + plr.Name + "'" );
  18. if ( GetSQLColumnData( check, 0 ) == null )
  19. {
  20. local q = QuerySQL( db, "SELECT * FROM Alias WHERE Name='" + plr.Name + "'" );
  21. if ( GetSQLColumnData( q, 1 ) && GetSQLColumnData( q, 0 ) != null )
  22. }
  23. local ip = GetSQLColumnData( q, 1 ) , uid = GetSQLColumnData( q, 2 );
  24. AddBan( player.Name, plr.Name, expire, reason, ip, uid, "off" );
  25. }
  26. else MessagePlayer( "> "+plr.Name+" UID cannot be found.", player );
  27. FreeSQLQuery( q );
  28. }
  29. else MessagePlayer( "> "+plr.Name+" is already banned.", player );
  30. FreeSQLQuery( check );
  31. }
  32. }
Add Comment
Please, Sign In to add comment