Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- //Dialogs
- #define D_Panel 500
- #define D_HostName 501
- #define D_GameModeText 502
- #define D_MapName 503
- #define D_Exec 504
- #define D_Kick 505
- #define D_Ban 506
- #define D_ChangeMode 507
- #define D_Gmx 508
- #define D_Say 509
- #define D_BanIP 510
- #define D_UnBanIP 511
- #define D_Gravity 512
- #define D_Weather 513
- #define D_LoadFS 514
- #define D_Weburl 515
- #define D_UnLoadFS 516
- #define D_ReloadFS 517
- #define D_RCON_PASSWORD 518
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
- new string[256];
- switch(dialogid){
- case 500:{
- if(!response)return 1;
- switch(listitem){
- case 0:ShowPlayerDialog(playerid,D_HostName,1,"Edit Host Name","Write the new host name:","Accept","Cancel");
- case 1:ShowPlayerDialog(playerid,D_GameModeText,1,"Edit Game Mode Text","Write the new game mode text:","Accept","Cancel");
- case 2:ShowPlayerDialog(playerid,D_MapName,1,"Edit Map Name","Write the new map name:","Accept","Cancel");
- case 3:ShowPlayerDialog(playerid,D_Exec,1,"Edit Exec","Write the file you want to exec:","Accept","Cancel");
- case 4:ShowPlayerDialog(playerid,D_Kick,1,"Kick Player","Write ID for kick:","Accept","Cancel");
- case 5:ShowPlayerDialog(playerid,D_Ban,1,"Ban Player","Write ID for ban:","Accept","Cancel");
- case 6:ShowPlayerDialog(playerid,D_ChangeMode,1,"Edit Mode","Write the name of new mode:","Accept","Cancel");
- case 7:ShowPlayerDialog(playerid,D_Gmx,1,"GMX - Restart","Write the reason for GMX:","Accept","Cancel");
- case 8:SendRconCommand("reloadbans"),SendClientMessage(playerid,-1,"You have been reload server bans.");
- case 9:SendRconCommand("reloadlog"),SendClientMessage(playerid,-1,"You have been reload server log.");
- case 10:ShowPlayerDialog(playerid,D_Say,1,"Say Server","Write what you want say:","Say","Cancel");
- case 11:SendRconCommand("players");
- case 12:ShowPlayerDialog(playerid,D_BanIP,1,"Ban IP","Write IP to give ban:","Accept","Cancel");
- case 13:ShowPlayerDialog(playerid,D_UnBanIP,1,"UnBan IP","Write IP to give un ban:","Accept","Cancel");
- case 14:ShowPlayerDialog(playerid,D_Gravity,1,"Edit Gravity","Write the new number of gravity:","Accept","Cancel");
- case 15:ShowPlayerDialog(playerid,D_Weather,1,"Edit Weather","Write the new number of weather:","Accept","Cancel");
- case 16:ShowPlayerDialog(playerid,D_LoadFS,1,"Load FilterScript","Write the name of filterscript:","Accept","Cancel");
- case 17:ShowPlayerDialog(playerid,D_Weburl,1,"Edit Webrul","Write the name of new webrul:","Accept","Cancel");
- case 18:ShowPlayerDialog(playerid,D_UnLoadFS,1,"UnLoad FilterScript","Write the name of filterscript:","Accept","Cancel");
- case 19:ShowPlayerDialog(playerid,D_ReloadFS,1,"Reload FilterScript","Write the name of filterscript:","Accept","Cancel");
- case 20:ShowPlayerDialog(playerid,D_RCON_PASSWORD,3,"Edit RCON PASSWORD","Write the new RCON PASSWORD","Accept","Cancel");}}
- case D_HostName:format(string, sizeof(string), "hostname %s", inputtext),SendRconCommand(string);
- case D_GameModeText:format(string, sizeof(string), "gamemodetext %s", inputtext),SendRconCommand(string);
- case D_MapName:format(string, sizeof(string), "mapname %s", inputtext),SendRconCommand(string);
- case D_Exec:format(string, sizeof(string), "exec %s", inputtext),SendRconCommand(string);
- case D_Kick:Kick(strval(inputtext));
- case D_Ban:Ban(strval(inputtext));
- case D_ChangeMode:format(string, sizeof(string), "changemode %s", inputtext),SendRconCommand(string);
- case D_Gmx:format(string,sizeof(string),"SERVER: Gamemode is restarting.. Reason: %s",inputtext),SendClientMessageToAll(-1,string),SendRconCommand("gmx");
- case D_Say:format(string,sizeof(string),"say %s",inputtext),SendRconCommand(string);
- case D_BanIP:format(string,sizeof(string),"banip %s",inputtext),SendRconCommand(string);
- case D_UnBanIP:format(string,sizeof(string),"unbanip %s",inputtext),SendRconCommand(string);
- case D_Gravity:format(string,sizeof(string),"gravity %s",inputtext),SendRconCommand(string);
- case D_Weather:format(string,sizeof(string),"weather %d",strval(inputtext)),SendRconCommand(string);
- case D_LoadFS:format(string,sizeof(string),"loadfs %s",inputtext),SendRconCommand(string);
- case D_Weburl:format(string,sizeof(string),"weburl %s",inputtext),SendRconCommand(string);
- case D_UnLoadFS:format(string,sizeof(string),"unloadfs %s",inputtext),SendRconCommand(string);
- case D_ReloadFS:format(string,sizeof(string),"reloadfs %s",inputtext),SendRconCommand(string);
- case D_RCON_PASSWORD:format(string,sizeof(string),"rcon_password %s",inputtext),SendRconCommand(string);}
- return 1;}
- public OnPlayerCommandText(playerid, cmdtext[]){
- if(!strcmp(cmdtext, "/PRcon", true) && IsPlayerAdmin(playerid))return ShowPlayerDialog(playerid,D_Panel,2,"Edit Rcon Panel","Host Name\nGame Mode Text\nMap Name\nExec\nKick\nBan\nChange Mode\nGMX\nReload Bans\nReload Log\nSay\nPlayers\nBan IP\nUnBan IP\nGravity\nWeather\nLoad FS\nWebrul\nUnLoad FS\nReload FS\nRCON_PASSWORD","Select","Cancel");
- return 0;}
Advertisement
Add Comment
Please, Sign In to add comment