Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================================================
- /*
- #AdminPanel/System
- #Author > eksepted
- */
- //==============================================================================
- #include <a_samp>
- #include <YSI\y_ini>
- #include <zcmd>
- #include <streamer>
- #include <sscanf2>
- //==============================================================================
- #define SCM SendClientMessage
- #define DSI DIALOG_STYLE_INPUT
- #define SPD ShowPlayerDialog
- //==============================================================================
- main()
- {
- print("\n----------------------------------");
- print(" ADMIN MENU BY EKSEPTED");
- print("----------------------------------\n");
- }
- enum {
- DIALOG_SERVER,
- DIALOG_SRWIME,
- DIALOG_SRWGM,
- DIALOG_SRWPW
- }
- public OnGameModeInit()
- {
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- stock GetName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_SERVER)
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- SPD(playerid, DIALOG_SRWIME, DSI, "Ime servera", "U prazno polje, unesite novo ime servera.", "Postavi", "Odustani");
- }
- case 1:
- {
- SPD(playerid, DIALOG_SRWGM, DSI, "Ime Gamemoda", "U prazno polje, unesite novo ime gamemoda.", "Postavi", "Odustani");
- }
- case 2:
- {
- SPD(playerid, DIALOG_SRWPW, DSI, "Zakljucavanje servera", "U prazno polje, unesite zeljenu lozinku za server.", "Postavi", "Odustani");
- }
- case 3:
- {
- new string[128];
- format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} Od sada je server {0CFF00}otkljucan.");
- SendClientMessageToAll(-1, string);
- SCM(playerid, -1, "{1F85DE}INFO >{FFFFFF} Otkljucao si server.");
- SendRconCommand("password 0");
- }
- case 4:
- {
- new string[128];
- format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} Pokrenut je restart servera, server ce se restartovati za 15 sec.");
- SendClientMessageToAll(-1, string);
- SCM(playerid, -1, "{1F85DE}INFO >{FFFFFF} Pokrenuo si restartovanje servera.");
- SetTimer("Restart", 15000, false);
- }
- }
- }
- if(dialogid == DIALOG_SRWIME)
- {
- if(response)
- {
- new string[128];
- format(string,sizeof(string),"hostname %s",inputtext);
- SendRconCommand(string);
- format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} %s je postavio novo ime servera na > {1F85DE}%s", GetName(playerid), inputtext);
- SendClientMessageToAll(-1, string);
- }
- }
- if(dialogid == DIALOG_SRWGM)
- {
- if(response)
- {
- new string[128];
- format(string,sizeof(string),"%s",inputtext);
- SetGameModeText(string);
- format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} %s je postavio novo ime gamemoda na > {1F85DE}%s", GetName(playerid), inputtext);
- SendClientMessageToAll(-1, string);
- }
- }
- if(dialogid == DIALOG_SRWPW)
- {
- if(response)
- {
- new string[128];
- format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} Od sada je server {FF0000}zakljucan.");
- SendClientMessageToAll(-1, string);
- format(string, sizeof(string), "{1F85DE}INFO >{FFFFFF} Zakljucao si server, nova lozinka servera je: {1F85DE}%s", inputtext);
- SCM(playerid, -1, string);
- SendRconCommand("password %s");
- }
- }
- return 1;
- }
- //==============================================================================
- CMD:server(playerid, params[]) {
- //if(PI[playerid][pAdmin] < 6)
- //return SCM(playerid, -1, "Niste ovlasceni");
- new srwmog[1024];
- format(srwmog,1024,"[1] > Promeni Ime Servera\n[2] > Promeni Ime GameMode-a\n[3] > Zakljucaj Server\n[4] > Otkljucaj Server\n[5] > Restartuj Server");
- ShowPlayerDialog(playerid, DIALOG_SERVER, DIALOG_STYLE_LIST, "Server Mogucnosti:", srwmog, "Odaberi", "Odustani");
- return (true);
- }
Advertisement
Add Comment
Please, Sign In to add comment