Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Autojailer 1.0 (www.exro-online.com)
- /*
- DROP TABLE IF EXISTS `autojail`;
- CREATE TABLE `autojail` (
- `account_id` int(11) NOT NULL,
- `reason` text NOT NULL,
- `last_login` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`account_id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
- */
- - script AutoJail -1,{
- OnPCLoginEvent:
- if( Query_SQL( "SELECT `reason` FROM `autojail` WHERE `account_id` = " + GetCharID( 3 ), .@reason$ ) == 0 )
- end;
- Query_SQL( "UPDATE `autojail` SET `last_login` = NOW() WHERE `account_id` = " + GetCharID( 3 ) );
- mes "[^FF0000ExRO AutoJail^000000]";
- mes "Bitte melde dich umgehend bei einem GM oder dem Admin!";
- mes "^FF0000------ Grund ------^000000";
- mes .@reason$[ 0 ];
- close2;
- GetMapXY( .@map$, .@x, .@y, 0 );
- if( .@map$ != "sec_pri" )
- AtCommand( "!jail " + StrCharInfo( 0 ) );
- end;
- // Admin Panel
- OnWhisperGlobal:
- if( GetGMLevel() < 80 )
- end;
- set .@npcname$, "[^FF0000Admin Panel^000000]";
- mes .@npcname$;
- mes "Was möchtest du tun?";
- if( Select( "Account ^008800eintragen^000000", "Account ^FF0000entfernen^000000", "Alle Spieler einsehen", "Beenden" ) == 4 )
- close;
- // alle Auflisten
- if( @menu == 3 ) {
- next;
- set .@c, Query_SQL( "SELECT `account_id`, `reason`, DATE_FORMAT(`last_login`, '%d.%m.%Y' ) FROM `autojail`", .@aid, .@reason$, .@date$ );
- if( .@c == 0 ) {
- mes .@npcname$;
- mes "^FF0000Derzeit sind keine Accounts im Autojail eingetragen^000000";
- close;
- }
- mes "[^FF0000Autojail Liste - " + .@c + " Accounts^000000]";
- mes "[Nr] <AID> (<letzter Login>)";
- for( set .@i, 0; .@i < .@c; set .@i, .@i + 1 )
- mes "[" + ( .@i + 1 ) + "] " + .@aid[ .@i ] + " (" + .@date$[ .@i ] + ")";
- close;
- }
- // Account hinzufügen/entfernen
- mes "Spieler Name?";
- do {
- Input( .@name$ );
- set .@c, Query_Sql( "SELECT `account_id` FROM `char` WHERE `name` = '" + .@name$ + "'", .@AccountID );
- if( .@c == 0 ) {
- mes "^ff0000'" + .@name$ + "' wurde nicht gefunden!^000000";
- if( Select( "nochmal eingeben", "Beenden" ) == 2 )
- close;
- }
- } while( .@c < 1 );
- set .@jCount, Query_SQL( "SELECT `account_id`, `reason`, DATE_FORMAT(`last_login`, '%d.%m.%Y' ) FROM `autojail` WHERE `account_id` = " + .@AccountID, .@aid, .@reason$, .@date$ );
- mes "^0000FFAccount^000000: " + .@name$ + " [" + .@AccountID + "]";
- if( .@jCount > 0 ) {
- mes "^0000FFJail Grund^000000: " + .@reason$;
- mes "^0000FFJail Login^000000: " + .@date$;
- }
- // hinzufügen
- if( @menu == 1 ) {
- if( Select( "Okay, eintragen!", "Abbrechen!" ) == 2 ){
- mes "^ff0000Abbruch...^000000";
- close;
- }
- mes "Bitte den Grund eingeben!";
- Input( .@reason$ );
- if( .@jCount == 0 ) // nicht in Table
- Query_SQL( "INSERT INTO `autojail` VALUES ( " + .@AccountID + ", '" + .@reason$ + "', '0000-00-00 00:00:00' );" );
- else
- Query_SQL( "UPDATE `autojail` SET `reason` = '" + .@reason$ + "' WHERE `account_id` = " + .@AccountID );
- mes "^008800Erfolgreich eingetragen!^000000";
- close;
- }
- // enfernen
- if( .@jCount == 0 ) {
- mes "^FF0000Der Account steht nicht im AutoJail!^000000";
- close;
- }
- if( Select( "Okay, entfernen!", "Abbrechen!" ) == 2 ){
- mes "^ff0000Abbruch...^000000";
- close;
- }
- Query_SQL( "DELETE FROM `autojail` WHERE account_id = " + .@AccountID );
- mes "^008800Erfolgreich entfernt!^000000";
- close;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement