Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- .--"""""--._
- .' '.
- / \
- ; By Msk. \
- | |
- | |
- \ |
- H \ (`'--, ,--'`) /
- A \ \ _ ) ( _ / /
- R ) )(')/ \(')( (
- D (_ `""` /\ `""` _)
- C \`"-, / \ ,-"`/
- O `\ / `""` \ /`
- R |/\/\/\/\/\|
- E |\ /|
- ; |/\/\/\| ;
- S \`-`--`-`/
- C \ /
- R ',__,'
- I
- P Server IG Panel V.1
- T
- E
- R
- */
- #include <a_samp>
- #include <zcmd>
- #define D_GMN 1
- #define D_MP 2
- #define D_FL 3
- #define D_FEL 4
- #define D_NAL 5
- #define D_UZE 6
- new Text:Textdraw [ 16 ];
- new max_ping = 500;
- new ping_warnings [ MAX_PLAYERS ] = 0;
- forward PingCheck();
- public PingCheck()
- {
- for ( new x = 0; x < MAX_PLAYERS; x++) {
- new str1 [ 128 ], pName [ MAX_PLAYER_NAME+1 ];
- if ( GetPlayerPing (x ) >= max_ping )
- {
- ping_warnings [ x ]++;
- if ( ping_warnings[x] == 3 )
- GetPlayerName ( x, pName, MAX_PLAYER_NAME+1 );
- format ( str1, 128, "{FFFFFF}**** %d wurde wegen zu hohen Ping gekickt(Max Ping: %d)", pName,max_ping );
- SendClientMessageToAll ( -1, str1 );
- Kick ( x );
- }
- }
- return 1;
- }
- CMD:panel(playerid,params[])
- {
- if ( !IsPlayerAdmin ( playerid ) )
- return SendClientMessage ( playerid,0xFFFFFFFF,"[Fehler]: Du bist kein Admin" );
- SelectTextDraw ( playerid, 0xFF0005FF );
- for ( new x = 0; x < 16; x++ ) {
- SendClientMessage ( playerid, 0xFFFFFFFF, "" ); }
- ShowAll ( playerid );
- return 1;
- }
- public OnFilterScriptInit()
- {
- SetTimer ( "PingCheck", 5000, 1 );
- Textdraw [ 0 ] = TextDrawCreate(600.000000, 63.000000, " ");
- TextDrawBackgroundColor(Textdraw [ 0 ] , 255);
- TextDrawFont(Textdraw [ 0 ] , 1);
- TextDrawLetterSize(Textdraw [ 0 ] , 0.500000, 1.000000);
- TextDrawColor(Textdraw [ 0 ] , -1);
- TextDrawSetOutline(Textdraw [ 0 ] , 0);
- TextDrawSetProportional(Textdraw [ 0 ] , 1);
- TextDrawSetShadow(Textdraw [ 0 ] , 1);
- TextDrawUseBox(Textdraw [ 0 ] , 1);
- TextDrawBoxColor(Textdraw [ 0 ] , 204);
- TextDrawTextSize(Textdraw [ 0 ] , 46.000000, 0.000000);
- Textdraw [ 1 ] = TextDrawCreate(50.000000, 63.000000, " Server Einstellungen");
- TextDrawBackgroundColor(Textdraw [ 1 ], 255);
- TextDrawFont(Textdraw [ 1 ], 1);
- TextDrawLetterSize(Textdraw [ 1 ], 0.500000, 2.200000);
- TextDrawColor(Textdraw [ 1 ], -1);
- TextDrawSetOutline(Textdraw [ 1 ], 0);
- TextDrawSetProportional(Textdraw [ 1 ], 1);
- TextDrawSetShadow(Textdraw [ 1 ], 1);
- TextDrawUseBox(Textdraw [ 1 ], 1);
- TextDrawBoxColor(Textdraw [ 1 ], 65535);
- TextDrawTextSize(Textdraw [ 1 ], 596.000000, 0.000000);
- Textdraw [ 2 ] = TextDrawCreate(80.000000, 120.000000, "Gamemode Name");
- TextDrawBackgroundColor(Textdraw [ 2 ] , 255);
- TextDrawFont(Textdraw [ 2 ] , 1);
- TextDrawLetterSize(Textdraw [ 2 ] , 0.310000, 2.000000);
- TextDrawColor(Textdraw [ 2 ] , -1);
- TextDrawSetOutline(Textdraw [ 2 ] , 0);
- TextDrawSetProportional(Textdraw [ 2 ] , 1);
- TextDrawSetShadow(Textdraw [ 2 ] , 1);
- TextDrawUseBox(Textdraw [ 2 ] , 1);
- TextDrawBoxColor(Textdraw [ 2 ] , 255);
- TextDrawTextSize(Textdraw [ 2 ] , 169.000000, 15.000000);
- TextDrawSetSelectable(Textdraw [ 2 ], 1);
- Textdraw [ 3 ] = TextDrawCreate(80.000000, 171.000000, "Maximaler Ping");
- TextDrawBackgroundColor(Textdraw [ 3 ], 255);
- TextDrawFont(Textdraw [ 3 ], 1);
- TextDrawLetterSize(Textdraw [ 3 ], 0.310000, 2.000000);
- TextDrawColor(Textdraw [ 3 ], -1);
- TextDrawSetOutline(Textdraw [ 3 ], 0);
- TextDrawSetProportional(Textdraw [ 3 ], 1);
- TextDrawSetShadow(Textdraw [ 3 ], 1);
- TextDrawUseBox(Textdraw [ 3 ], 1);
- TextDrawBoxColor(Textdraw [ 3 ], 255);
- TextDrawTextSize(Textdraw [ 3 ], 169.000000, 15.000000);
- TextDrawSetSelectable(Textdraw [ 3 ], 1);
- Textdraw [ 4 ] = TextDrawCreate(80.000000, 221.000000, "FS Laden");
- TextDrawBackgroundColor(Textdraw [ 4 ], 255);
- TextDrawFont(Textdraw [ 4 ], 1);
- TextDrawLetterSize(Textdraw [ 4 ], 0.310000, 2.000000);
- TextDrawColor(Textdraw [ 4 ], -1);
- TextDrawSetOutline(Textdraw [ 4 ], 0);
- TextDrawSetProportional(Textdraw [ 4 ], 1);
- TextDrawSetShadow(Textdraw [ 4 ], 1);
- TextDrawUseBox(Textdraw [ 4 ], 1);
- TextDrawBoxColor(Textdraw [ 4 ], 255);
- TextDrawTextSize(Textdraw [ 4 ], 169.000000, 15.000000);
- TextDrawSetSelectable(Textdraw [ 4 ], 1);
- Textdraw [ 5 ] = TextDrawCreate(80.000000, 270.000000, "FS Entladen");
- TextDrawBackgroundColor(Textdraw [ 5 ], 255);
- TextDrawFont(Textdraw [ 5 ], 1);
- TextDrawLetterSize(Textdraw [ 5 ], 0.310000, 2.000000);
- TextDrawColor(Textdraw [ 5 ], -1);
- TextDrawSetOutline(Textdraw [ 5 ], 0);
- TextDrawSetProportional(Textdraw [ 5 ], 1);
- TextDrawSetShadow(Textdraw [ 5 ], 1);
- TextDrawUseBox(Textdraw [ 5 ], 1);
- TextDrawBoxColor(Textdraw [ 5 ], 255);
- TextDrawTextSize(Textdraw [ 5 ], 169.000000, 15.000000);
- TextDrawSetSelectable(Textdraw [ 5 ], 1);
- Textdraw [ 6 ] = TextDrawCreate(470.000000, 270.000000, "Nachricht an Alle");
- TextDrawBackgroundColor(Textdraw [ 6 ], 255);
- TextDrawFont(Textdraw [ 6 ], 1);
- TextDrawLetterSize(Textdraw [ 6 ], 0.310000, 2.000000);
- TextDrawColor(Textdraw [ 6 ], -1);
- TextDrawSetOutline(Textdraw [ 6 ], 0);
- TextDrawSetProportional(Textdraw [ 6 ], 1);
- TextDrawSetShadow(Textdraw [ 6 ], 1);
- TextDrawUseBox(Textdraw [ 6 ], 1);
- TextDrawBoxColor(Textdraw [ 6 ], 255);
- TextDrawTextSize(Textdraw [ 6 ], 558.000000, 15.000000);
- TextDrawSetSelectable(Textdraw [ 6 ], 1);
- Textdraw [ 7 ] = TextDrawCreate(470.000000, 221.000000, "Uhrzeit einstellen");
- TextDrawBackgroundColor(Textdraw [ 7 ], 255);
- TextDrawFont(Textdraw [ 7 ], 1);
- TextDrawLetterSize(Textdraw [ 7 ], 0.310000, 2.000000);
- TextDrawColor(Textdraw [ 7 ], -1);
- TextDrawSetOutline(Textdraw [ 7 ], 0);
- TextDrawSetProportional(Textdraw [ 7 ], 1);
- TextDrawSetShadow(Textdraw [ 7 ], 1);
- TextDrawUseBox(Textdraw [ 7 ], 1);
- TextDrawBoxColor(Textdraw [ 7 ], 255);
- TextDrawTextSize(Textdraw [ 7 ], 558.000000, 15.000000);
- TextDrawSetSelectable(Textdraw [ 7 ], 1);
- Textdraw [ 8 ] = TextDrawCreate(470.000000, 171.000000, "..:V.1:..");
- TextDrawBackgroundColor(Textdraw [ 8 ], 255);
- TextDrawFont(Textdraw [ 8 ], 1);
- TextDrawLetterSize(Textdraw [ 8 ], 0.310000, 2.000000);
- TextDrawColor(Textdraw [ 8 ], -1);
- TextDrawSetOutline(Textdraw [ 8 ], 0);
- TextDrawSetProportional(Textdraw [ 8 ], 1);
- TextDrawSetShadow(Textdraw [ 8 ], 1);
- TextDrawUseBox(Textdraw [ 8 ], 1);
- TextDrawBoxColor(Textdraw [ 8 ], 255);
- TextDrawTextSize(Textdraw [ 8 ], 558.000000, 15.000000);
- Textdraw [ 9 ] = TextDrawCreate(470.000000, 121.000000, "..:V.1:..");
- TextDrawBackgroundColor(Textdraw [ 9 ], 255);
- TextDrawFont(Textdraw [ 9 ], 1);
- TextDrawLetterSize(Textdraw [ 9 ], 0.310000, 2.000000);
- TextDrawColor(Textdraw [ 9 ], -1);
- TextDrawSetOutline(Textdraw [ 9 ], 0);
- TextDrawSetProportional(Textdraw [ 9 ], 1);
- TextDrawSetShadow(Textdraw [ 9 ], 1);
- TextDrawUseBox(Textdraw [ 9 ], 1);
- TextDrawBoxColor(Textdraw [ 9 ], 255);
- TextDrawTextSize(Textdraw [ 9 ], 558.000000, 15.000000);
- Textdraw [ 10 ] = TextDrawCreate(284.000000, 218.000000, "~b~Erstellt durch: ~g~Msk~r~.");
- TextDrawBackgroundColor(Textdraw [ 10 ], 255);
- TextDrawFont(Textdraw [ 10 ], 1);
- TextDrawLetterSize(Textdraw [ 10 ], 0.200000, 1.599999);
- TextDrawColor(Textdraw [ 10 ], -1);
- TextDrawSetOutline(Textdraw [ 10 ], 0);
- TextDrawSetProportional(Textdraw [ 10 ], 1);
- TextDrawSetShadow(Textdraw [ 10 ], 1);
- Textdraw [ 11 ] = TextDrawCreate(268.000000, 230.000000, "................");
- TextDrawBackgroundColor(Textdraw [ 11 ], 255);
- TextDrawFont(Textdraw [ 11 ], 1);
- TextDrawLetterSize(Textdraw [ 11 ], 0.500000, 1.000000);
- TextDrawColor(Textdraw [ 11 ], -1);
- TextDrawSetOutline(Textdraw [ 11 ], 0);
- TextDrawSetProportional(Textdraw [ 11 ], 1);
- TextDrawSetShadow(Textdraw [ 11 ], 1);
- Textdraw [ 12 ] = TextDrawCreate(266.000000, 204.000000, "~n~.~n~.");
- TextDrawBackgroundColor(Textdraw [ 12 ] , 255);
- TextDrawFont(Textdraw [ 12 ] , 1);
- TextDrawLetterSize(Textdraw [ 12 ] , 0.500000, 1.000000);
- TextDrawColor(Textdraw [ 12 ] , -1);
- TextDrawSetOutline(Textdraw [ 12 ] , 0);
- TextDrawSetProportional(Textdraw [ 12 ] , 1);
- TextDrawSetShadow(Textdraw [ 12 ] , 1);
- Textdraw [ 13 ] = TextDrawCreate(359.000000, 204.000000, "~n~.~n~.");
- TextDrawBackgroundColor(Textdraw [ 13 ], 255);
- TextDrawFont(Textdraw [ 13 ], 1);
- TextDrawLetterSize(Textdraw [ 13 ], 0.500000, 1.000000);
- TextDrawColor(Textdraw [ 13 ], -1);
- TextDrawSetOutline(Textdraw [ 13 ], 0);
- TextDrawSetProportional(Textdraw [ 13 ], 1);
- TextDrawSetShadow(Textdraw [ 13 ], 1);
- Textdraw [ 14 ] = TextDrawCreate(268.000000, 208.000000, "................");
- TextDrawBackgroundColor(Textdraw [ 14 ], 255);
- TextDrawFont(Textdraw [ 14 ], 1);
- TextDrawLetterSize(Textdraw [ 14 ], 0.500000, 1.000000);
- TextDrawColor(Textdraw [ 14 ], -1);
- TextDrawSetOutline(Textdraw [ 14 ], 0);
- TextDrawSetProportional(Textdraw [ 14 ], 1);
- TextDrawSetShadow(Textdraw [ 14 ], 1);
- Textdraw [ 15 ] = TextDrawCreate(282.000000, 340.000000, "Beenden");
- TextDrawBackgroundColor(Textdraw [ 15 ], 255);
- TextDrawFont(Textdraw [ 15 ], 1);
- TextDrawLetterSize(Textdraw [ 15 ], 0.500000, 2.400000);
- TextDrawColor(Textdraw [ 15 ], -1);
- TextDrawSetOutline(Textdraw [ 15 ], 0);
- TextDrawSetProportional(Textdraw [ 15 ], 1);
- TextDrawSetShadow(Textdraw [ 15 ], 1);
- TextDrawUseBox(Textdraw [ 15 ], 1);
- TextDrawBoxColor(Textdraw [ 15 ], 255);
- TextDrawTextSize(Textdraw [ 15 ], 350.000000, 15.000000);
- TextDrawSetSelectable(Textdraw [ 15 ], 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- for ( new x = 0; x < 16; x++ ) {
- TextDrawDestroy ( Textdraw [ x ] ); }
- return 1;
- }
- stock HideAll(playerid)
- {
- for ( new x = 0; x < 16; x++ ) {
- TextDrawHideForPlayer ( playerid, Textdraw [ x ] ); }
- PlayerPlaySound ( playerid, 1098, 0, 0, 0 );
- CancelSelectTextDraw ( playerid );
- return 1;
- }
- stock ShowAll(playerid)
- {
- for ( new x = 0; x < 16; x++ ) {
- TextDrawShowForPlayer ( playerid, Textdraw [ x ] ); }
- PlayerPlaySound ( playerid, 1097, 0, 0, 0 );
- SelectTextDraw ( playerid, 0xFF0005FF );
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if ( clickedid == Textdraw [ 2 ] ) {
- HideAll ( playerid );
- ShowPlayerDialog ( playerid, D_GMN ,DIALOG_STYLE_INPUT,"Gamemode Name","{FFFFFF}\n\n\nTrage unten den gewünschten Gamemode Namen ein:","Fertig","Abbrechen" );
- } if ( clickedid == Textdraw [ 3 ] ) {
- HideAll ( playerid );
- ShowPlayerDialog ( playerid,D_MP, DIALOG_STYLE_INPUT,"Maximaler Ping","{FFFFFF}\n\n\nTrage unten den gewünschten maximalen Ping ein:","Fertig","Abbrechen");
- } if ( clickedid == Textdraw [ 4 ] ) {
- HideAll ( playerid );
- ShowPlayerDialog ( playerid, D_FL, DIALOG_STYLE_INPUT,"Filterscript Laden","{FFFFFF}\n\n\nTrage unten den Namen von dem Filterscript ein den du laden möchtest","Fertig","Abbrechen" );
- } if ( clickedid == Textdraw [ 5 ] ) {
- HideAll ( playerid );
- ShowPlayerDialog ( playerid, D_FEL, DIALOG_STYLE_INPUT,"Filterscript Laden","{FFFFFF}\n\n\nTrage unten den Namen von dem Filterscript ein den du entladen möchtest","Fertig","Abbrechen" );
- } if ( clickedid == Textdraw [ 6 ] ) {
- HideAll ( playerid );
- ShowPlayerDialog ( playerid, D_NAL, DIALOG_STYLE_INPUT," Nachricht an Alle","{FFFFFF}\n\n\nTrage unten deine Nachricht ein, die alle sehen werden","Fertig","Abbrechen" );
- } if ( clickedid == Textdraw [ 7 ] ) {
- HideAll ( playerid );
- ShowPlayerDialog ( playerid, D_UZE, DIALOG_STYLE_INPUT," Uhrzeit einstellen","{FFFFFF}\n\n\nTrage unten die gewünschte uhrzeit ein: ","Fertig","Abbrechen" );
- } if ( clickedid == Textdraw [ 15 ] ) {
- HideAll ( playerid );
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if ( dialogid == D_GMN && response == 1 ) {
- if ( strlen ( inputtext ) == 0 ) {
- SendClientMessage ( playerid, 0xFFFFFFFF, "Falsche angabe" );
- ShowPlayerDialog ( playerid, D_GMN ,DIALOG_STYLE_INPUT,"Gamemode Name","{FFFFFF}\n\n\nTrage unten den gewünschten Gamemode Namen ein:","Fertig","Abbrechen" ); return 0; }
- SetGameModeText ( inputtext ); SendClientMessage ( playerid, 0xFFFFFFFF, "Erfolgreich" );
- PlayerPlaySound ( playerid, 1057, 0, 0, 0 );
- }
- if ( dialogid == D_MP && response == 1 ) {
- if ( !IsNumeric ( inputtext ) )
- return SendClientMessage ( playerid,0xFFFFFFF,"Du hast ein unerlaubtes zeichen eingetragen" );
- max_ping = strval ( inputtext );
- if ( max_ping < 100 ) { max_ping = 500; ShowPlayerDialog ( playerid,D_MP,DIALOG_STYLE_INPUT,"Maximaler Ping","Der Maximaler Ping muss höher als 100 sein","Fertig","Abbrechen" ); return 0;}
- new str1 [ 222 ];
- format ( str1, 222, "Erfolgreich, Maximaler Ping eingestellt{FF0000}(%d)", max_ping );
- SendClientMessage ( playerid, 0xFFFFFFFF, str1 );
- PlayerPlaySound ( playerid, 1057, 0, 0, 0 );
- }
- if ( dialogid == D_FL && response == 1 ) {
- if ( strlen ( inputtext ) == 0 ) {
- SendClientMessage ( playerid, 0xFFFFFFFFF, "Falsche angabe" );
- ShowPlayerDialog ( playerid, D_FL, DIALOG_STYLE_INPUT,"Filterscript Laden","{FFFFFF}\n\n\nTrage unten den Namen von dem Filterscript ein den du laden möchtest","Fertig","Abbrechen" );
- return 0; }
- new str2 [ 100 ];
- format ( str2 ,100, "loadfs %s", inputtext );
- SendRconCommand ( str2 );
- format ( str2, 100, "Filterscript: %s geladen" ,inputtext );
- SendClientMessage ( playerid, 0xFFFFFFFF, str2 );
- }
- if ( dialogid == D_FEL && response == 1 ) {
- if ( strlen ( inputtext ) == 0 ) {
- SendClientMessage ( playerid, 0xFFFFFFFFF, "Falsche angabe" );
- ShowPlayerDialog ( playerid, D_FEL, DIALOG_STYLE_INPUT,"Filterscript Laden","{FFFFFF}\n\n\nTrage unten den Namen von dem Filterscript ein den du entladen möchtest","Fertig","Abbrechen" );
- return 0; }
- new str2 [ 100 ];
- format ( str2 ,100, "unloadfs %s", inputtext );
- SendRconCommand ( str2 );
- format ( str2, 100, "Filterscript: %s entladet" ,inputtext );
- SendClientMessage ( playerid, 0xFFFFFFFF, str2 );
- }
- if ( dialogid == D_NAL && response == 1 ) {
- if ( strlen ( inputtext ) == 0 ) {
- SendClientMessage ( playerid,0xFFFFFFFF, "Falsche angabe" );
- ShowPlayerDialog ( playerid, D_NAL, DIALOG_STYLE_INPUT," Nachricht an Alle","{FFFFFF}\n\n\nTrage unten deine Nachricht ein, die alle sehen werden","Fertig","Abbrechen" );
- return 0; }
- new str [ 266 ];
- format ( str, 266, "{FF0000}Admin:{FFFFFF} %s",inputtext );
- SendClientMessageToAll ( -1, str );
- }
- if ( dialogid == D_UZE && response == 1 ) {
- if ( !IsNumeric ( inputtext ) )
- return SendClientMessage ( playerid, 0xFFFFFFFF," Falsche angabe" );
- new varr;
- varr = strval ( inputtext );
- if ( varr < 1 || varr > 24 )
- return SendClientMessage ( playerid, 0xFFFFFFFF," Falsche uhrzeit" );
- SetWorldTime ( varr );
- SendClientMessage ( playerid, 0xFFFFFFFF, "Erfolgreich" );
- }
- return 1;
- }
- stock IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement