Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if ( cmd == "!warn" )
- {
- if ( level < 3 ) EchoNotice1( user, ICOL_RED + "Error - Your level is not high enough to use that command." );
- else if ( !text ) EchoNotice1(user, ICOL_RED+ "Error - Syntax: /" + cmd + " <Nick/ID> <Reason> " );
- else
- {
- local plr =FindPlayer(GetTok( text, " ", 1 ));
- local reason = GetTok( text, " ", 2, NumTok( text, " " ) );
- if(plr)
- {
- if(reason)
- {
- local q = QuerySQL( db, "SELECT * FROM Warning WHERE Name ='" + plr.Name + "'");
- if ( !GetSQLColumnData( q, 0 ) )
- {
- QuerySQL( db, "INSERT INTO Warning (Name, Totalwarns) values ( '" + plr.Name + "', 1 )" );
- Message( RED+"Admin "+user+" has warned "+plr.Name+". Reason: "+ reason +". Warns: "+RED+"[ 1/3 ]");
- EchoMessage1( ICOL_RED+"Admin "+user+" has warned "+plr.Name+". Reason: "+ reason +". Warns: [ 1/3 ]");
- }
- else
- {
- local warntotal = GetSQLColumnData(q, 1)+1;
- QuerySQL( db, "UPDATE Warning SET Totalwarns='" + warntotal + "' WHERE Name='" + plr.Name + "'")
- Message( RED+"Admin "+user+" has warned "+plr.Name+". Reason: "+ reason +". Warns: [ " + warntotal + "/" + "3 ]");
- EchoMessage1( ICOL_RED+"Admin "+user+" has warned "+plr.Name+". Reason: "+ reason +". Warns: [ " + warntotal + "/" + "3 ]");
- if(GetSQLColumnData(q, 1)==2)
- {
- QuerySQL( db, "DELETE FROM Warning WHERE Name='" + plr.Name + "'")
- Message( RED+"Auto-Banned: " + plr.Name + ". Reason: Exceeded the number of warn limits.");
- EchoMessage1( ICOL_RED+"Auto-Banned: " + plr.Name + ". Reason: Exceeded the number of warn limits.");
- Ban( plr, "3d", "Exceeded the number of warn limits", "Server" );
- }
- }
- FreeSQLQuery( q );
- }
- else EchoNotice1(user, ICOL_RED+ "Syntax: " + cmd + " <Nick/ID> <Reason> " );
- }
- else EchoNotice1(user, ICOL_RED+ "Unknown player." );
- }
- }
- else if ( cmd == "!unwarn" )
- {
- if ( level < 3 ) EchoNotice1( user, ICOL_RED + "Error - Your level is not high enough to use that command." );
- else if ( !text ) EchoNotice1( user, ICOL_RED + "Error - Syntax: " + cmd + " <Nick/ID>");
- else
- {
- local plr = FindPlayer(GetTok( text, " ", 1 ));
- if(plr)
- {
- local q = QuerySQL( db, "SELECT * FROM Warning WHERE Name ='" + plr.Name + "'");
- if ( !GetSQLColumnData( q, 0 ) ) EchoNotice1( user, ICOL_RED + "Error - " + plr.Name + " didn't get any warns.");
- else if ( GetSQLColumnData( q, 0 ) == "0" ) EchoNotice1( user, ICOL_RED + "Error - " + plr.Name + " didn't get any warns.");
- else
- {
- local warntotal = "0";
- QuerySQL( db, "UPDATE Warning SET Totalwarns='" + warntotal + "' WHERE Name='" + plr.Name + "'")
- Message( RED+"Admin "+user+" has unwarned "+plr.Name+".");
- EchoMessage1( ICOL_RED+"Admin "+user+" has unwarned "+plr.Name+".");
- }
- FreeSQLQuery( q );
- }
- else EchoNotice1( user, ICOL_RED + "Error - Unknown Player");
- }
- }
Add Comment
Please, Sign In to add comment