MuhammadZeeshan

asfasf afgas gasgas gas

Dec 12th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. else if ( cmd == "!ban")
  2. {
  3. if ( level < 3 ) EchoNotice1( user, ICOL_RED + "Error - Your level is not high enough to use that command." );
  4. else if ( !text ) EchoNotice1(user,"Syntax: " + cmd + " <playername> <h/d/m> <Reason>" );
  5. else
  6. {
  7. local args = split( text, " " );
  8. local plr = GetPlayer(args[0]), duration = args[1], reason = GetTok( text, " ", 3, NumTok( text, " " ) );
  9. if (!duration) EchoNotice1(user,"Syntax: " + cmd + " <playername> <h/d/m> <Reason> " );
  10. else if(!reason) EchoNotice1(user,"Syntax: " + cmd + " <playername> <h/d/m> <Reason> " );
  11. else
  12. {
  13. if ( plr ) Ban( plr, plr.UniqueID, plr.IP, duration, reason, user );
  14. else
  15. {
  16. plr = args[0];
  17. local q = QuerySQL( db, "SELECT * FROM Alias WHERE Name='" + plr + "'" );
  18. if ( GetSQLColumnData( q, 1 ) && GetSQLColumnData( q, 0 ) != null )
  19. {
  20. local ip = "0.0.0.0", uid = GetSQLColumnData( q, 0 );
  21. Ban( plr, uid, ip, duration, reason, user );
  22. }
  23. else EchoNotice1( user, "> "+plr+"'s UID cannot be found, the player didn't join the server." );
  24. FreeSQLQuery( q );
  25. }
  26. }
  27. }
  28. }
Add Comment
Please, Sign In to add comment