Advertisement
Guest User

delator warn

a guest
Nov 26th, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. else if ( cmd == "!warn" )
  2. {
  3. if ( level < 4 ) EchoNotice( user, "4Voce não tem acesso a esse comando." );
  4. else
  5. {
  6. if ( !text ) EchoMessage( "4Error - Syntax: " + cmd + " <nick/ID> <Motivo>" );
  7. else
  8. {
  9. local plr = GetPlayer( GetTok( text, " ", 1 ) );
  10. if ( !plr ) EchoMessage( "4Error - Unknown player." );
  11. else if ( status[ plr.ID ].Level >= 5 ) EchoMessage( "4Error - Voce não pode advertir um admin." );
  12. else
  13. {
  14. status[ plr.ID ].Warn ++;
  15. local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
  16. if ( reason == null ) reason = "Nenhum";
  17. if ( status[ plr.ID ].Warn <= 2 )
  18. {
  19. yMessage( "** Admin. " + user + " advertiu " + plr.Name + ". Motivo: " + reason + " [" + status[ plr.ID ].Warn + "/3]." );
  20. EchoMessage( "13** Admin. " + user + " warned 4" + plr.Name + "13. Reason: 5" + reason + " [" + status[ plr.ID ].Warn + "/3]." );
  21. PrivMessage( "Aviso " + status[ plr.ID ].Warn + "/3!", plr );
  22. }
  23. if ( status[ plr.ID ].Warn == 3 )
  24. {
  25. QuerySQL( db, "INSERT INTO Bans ( Name, IP, Date, Admin, Reason ) VALUES ( '" + plr.Name + "', '" + plr.IP + "', '" + GetDate( date ) + "', 'Server', 'Warn [3/3]' )" );
  26. PrivMessage( "Voce foi advertido tres vezes!", plr );
  27. MessageAllExcept( "** Auto-ban " + plr.Name + ". Motivo: Warn [3/3]", plr );
  28. cKick( plr );
  29. }
  30. }
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement