// == [ INCLUDES ] == ////////////////////////////////////////////////////////// #include < a_samp > #include < sscanf2 > #include < zcmd > // == [ DEFINES ] == /////////////////////////////////////////////////////////// #define SCM SendClientMessage #define SPD ShowPlayerDialog #define DSI DIALOG_STYLE_INPUT #define DSL DIALOG_STYLE_LIST #define SendErrorMessage(%0,%1) \ SCM(%0, -1, "{FF0000}[ ERROR ]: {FFFFFF} "%1) #define SendInfoMessage(%0,%1) \ SCM(%0, -1, "{007799}[ INFO ]: {FFFFFF} "%1) // == [ DIALOG ] == //////////////////////////////////////////////////////////// #define dialog_SERVERPANEL 1000 #define dialog_SERVERNAME 1001 #define dialog_SERVERPW 1002 #define dialog_SERVERMAP 1003 #define dialog_SERVERRCONPW 1004 #define dialog_SERVERURL 1005 #define dialog_SERVERMODE 1006 // == [ PUBLIC ] == //////////////////////////////////////////////////////////// public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] ) { if( dialogid == dialog_SERVERPANEL ) { if( response ) { if( listitem == 0 ) { SPD( playerid, dialog_SERVERNAME, DSI, "{007799}- HOSTNAME SERVERA -","{007799}>{FFFFFF} Molimo da unesete novo ime servera\n{007799}>{FFFFFF} Molimo da pazljivo proverite pre promene","ODABERI","ODUSTANI" ); } if( listitem == 1 ) { SPD( playerid, dialog_SERVERPW, DSI, "{007799}- PASSWORD SERVERA -","{007799}>{FFFFFF} Molimo da unesete novu sifru servera\n{007799}>{FFFFFF} Molimo da pazljivo proverite pre promene","ODABERI","ODUSTANI" ); } if( listitem == 2 ) { SPD( playerid, dialog_SERVERMAP, DSI, "{007799}- MAPA SERVERA -","{007799}>{FFFFFF} Molimo da unesete novi weburl servera\n{007799}>{FFFFFF} Molimo da pazljivo proverite pre promene","ODABERI","ODUSTANI" ); } if( listitem == 3 ) { SPD( playerid, dialog_SERVERRCONPW, DSI, "{007799}- RCON PASSWORD SERVERA -","{007799}>{FFFFFF} Molimo da unesete novi rcon password servera\n{007799}>{FFFFFF} Molimo da pazljivo proverite pre promene","ODABERI","ODUSTANI" ); } if( listitem == 4 ) { SPD( playerid, dialog_SERVERURL, DSI, "{007799}- WEBURL SERVERA -","{007799}>{FFFFFF} Molimo da unesete novi weburl servera\n{007799}>{FFFFFF} Molimo da pazljivo proverite pre promene","ODABERI","ODUSTANI" ); } if( listitem == 5 ) { SPD( playerid, dialog_SERVERMODE, DSI, "{007799}- GAMEMODE SERVERA -","{007799}>{FFFFFF} Molimo da unesete novi gamemode text servera\n{007799}>{FFFFFF} Molimo da pazljivo proverite pre promene","ODABERI","ODUSTANI" ); } } } if( dialogid == dialog_SERVERNAME ) { new namestring[256]; if( response ) { format( namestring, sizeof( namestring ), "hostname %s", inputtext ); SendRconCommand( namestring ); SendInfoMessage( playerid, "Uspesno ste promenili ime servera!" ); } } if( dialogid == dialog_SERVERPW ) { new passwordstring[256]; if( response ) { format( passwordstring, sizeof( passwordstring ), "password %s", inputtext ); SendRconCommand( passwordstring ); SendInfoMessage( playerid, "Uspesno ste promenili sifru servera!" ); } } if( dialogid == dialog_SERVERMAP ) { new mapstring[256]; if( response ) { format( mapstring, sizeof( mapstring ), "mapname %s", inputtext ); SendRconCommand( mapstring ); SendInfoMessage( playerid, "Uspesno ste promenili mapu servera!" ); } } if( dialogid == dialog_SERVERRCONPW ) { new rconpwstring[256]; if( response ) { format( rconpwstring, sizeof( rconpwstring ), "rcon_password %s", inputtext ); SendRconCommand( rconpwstring ); SendInfoMessage( playerid, "Uspesno ste promenili rcon password servera!" ); } } if( dialogid == dialog_SERVERURL ) { new urlstring[256]; if( response ) { format( urlstring, sizeof( urlstring ), "weburl %s", inputtext ); SendRconCommand( urlstring ); SendInfoMessage( playerid, "Uspesno ste promenili weburl servera!" ); } } if( dialogid == dialog_SERVERMODE ) { new modestring[256]; if( response ) { format( modestring, sizeof( modestring ), "%s", inputtext ); SetGameModeText( modestring ); SendInfoMessage( playerid, "Uspesno ste promenili gamemode text servera!" ); } } return 1; } // == [ KOMANDE ] == /////////////////////////////////////////////////////////// CMD:rconpanel( playerid, params[] ) { if( !IsPlayerAdmin( playerid ) ) { SPD( playerid, dialog_SERVERPANEL, DSL, "{007799}- SERVER RCON PANEL -", "{007799}>{FFFFFF} HOSTNAME\n{007799}>{FFFFFF} PASSWORD\n{007799}>{FFFFFF} MAPNAME\n{007799}>{FFFFFF} RCON PASSWORD\n{007799}>{FFFFFF} WEB URL\n{007799}>{FFFFFF} GAMEMODE TEXT", "ODABERI", "ODUSTANI" ); } else SendErrorMessage( playerid, "Morate biti RCON Admin kako bi ste mogli da koristite ovu komandu!"); return 1; } // == [ KRAJ ] == //////////////////////////////////////////////////////////////