Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if ( cmd == "ban")
- {
- if ( status[ player.ID ].Registered == false ) ErrorMessage( "[#FFFFFF]You need to be a part of our community to use this command.", player );
- else if ( status[ player.ID ].Logged == false ) ErrorMessage( "[#FFFFFF]You need to be identified to use this command.", player );
- else if ( GetLevel( player ) < 5 ) MessagePlayer("[Error] You don't have access to use this Command.", player );
- else if ( !text ) ErrorMessage( "Syntax: /" + cmd + " <playername> <h/d/m> <Reason>", player );
- else if ( IsNoob( player, cmd ) ) return 0;
- else
- {
- local args = split( text, " " );
- local plr = GetPlayer(args[0]), duration = args[1], reason = GetTok( text, " ", 3, NumTok( text, " " ) );
- if ( !plr ) ErrorMessage( "Invalid player", player );
- else if (!duration) ErrorMessage( "Syntax: /" + cmd + " <playername> <h/d/m> <Reason> ", player );
- else if(!reason) ErrorMessage( "Syntax: /" + cmd + " <playername> <h/d/m> <Reason> ", player );
- else
- {
- Ban( plr, duration, reason, player );
- }
- }
- }
- else if ( cmd == "warn" )
- {
- if( GetLevel( player ) < 5 ) MessagePlayer("[Error] You don't have access to use this Command.", player );
- else if ( !text ) ErrorMessage( "Error - Syntax: /" + cmd + " <Nick/ID> <Reason> ", player );
- else if ( IsNoob( player, cmd ) ) return 0;
- 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 )" );
- ServerMessage( WHITE+"Admin "+RED+""+player.Name+" "+WHITE+"has warned "+RED+""+plr.Name+". "+WHITE+"Reason: "+RED+""+ reason +". "+WHITE+"Warns: "+RED+"[ 1/3 ]");
- }
- else
- {
- local warntotal = GetSQLColumnData(q, 1)+1;
- QuerySQL( db, "UPDATE Warning SET Totalwarns='" + warntotal + "' WHERE Name='" + plr.Name + "'")
- ServerMessage( WHITE+"Admin "+RED+""+player.Name+" "+WHITE+"has warned "+RED+""+plr.Name+". "+WHITE+"Reason: "+RED+""+ reason +". "+WHITE+"Warns: "+RED+"[ " + warntotal + "/" + "3 ]");
- if(GetSQLColumnData(q, 1)==2)
- {
- QuerySQL( db, "DELETE FROM Warning WHERE Name='" + plr.Name + "'")
- ServerMessage( WHITE+"Auto-Banned: "+RED+"" + plr.Name + ". "+WHITE+"Reason: "+RED+"Exceeded the number of warn limits.");
- Ban( plr, "3d", "Exceeded the number of warn limits", "Auto" );
- }
- }
- FreeSQLQuery( q );
- }
- else ErrorMessage( "Syntax: " + cmd + " <Nick/ID> <Reason> ", player );
- }
- else ErrorMessage( "Unknown player.", player );
- }
- }
Add Comment
Please, Sign In to add comment