Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Hostname, rcon change i sifra servera all in one
- #include < a_samp >
- enum
- {
- dialog_rconpanel,
- dialog_rconpanel1,
- dialog_rconpanel2,
- dialog_rconpanel3
- }
- COMMAND:izmenisve(playerid, params[])
- {
- ShowPlayerDialog(playerid, dialog_rconpanel ,DIALOG_STYLE_LIST,"{FFFFFF}Izaberite","Gamemode Name\nServer Ime\nRcon Password","Odaberi","Izadji");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == dialog_rconpanel)
- {
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,dialog_rconpanel1,DIALOG_STYLE_INPUT,"{FFFFFF}Gamemode","Postavite novo ime Gamemodea/Verzija skripte","Postavi","Izadji");
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,dialog_rconpanel2,DIALOG_STYLE_INPUT,"{FFFFFF}Server Ime","Postavite novo ime servera","Postavi","Izadji");
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid,dialog_rconpanel3,DIALOG_STYLE_INPUT,"{FFFFFF}Rcon Password","Postavite novi Rcon password","Postavi","Izadji");
- }
- }
- }
- else if(dialogid == dialog_rconpanel1)
- {
- new string[128];
- if(response)
- {
- format(string,sizeof(string),"%s",inputtext);
- SetGameModeText(string);
- MessageEx(playerid, -1,"{FFFFFF} %s upravo si promenio ime gamemoda/verzije na: '%s' !",GetName(playerid),inputtext);
- }
- }
- else if(dialogid == dialog_rconpanel2)
- {
- new string[150];
- if(response)
- {
- format(string,sizeof(string),"hostname %s",inputtext);
- SendRconCommand(string);
- MessageEx(playerid, -1,"{FFFFFF} %s upravo si promenio ime servera na: '%s'!",GetName(playerid),inputtext);
- }
- }
- else if(dialogid == dialog_rconpanel3)
- {
- new string[128];
- if(response)
- {
- format(string,sizeof(string),"rcon_password %s",inputtext);
- SendRconCommand(string);
- MessageEx(playerid, -1, "{FFFFFF} %s upravo si promenio rcon password na: '%s'!",GetName(playerid),inputtext);
- }
- }
- return 1;
- }
- stock MessageEx(playerid,color,fstring[],{Float, _}:...)
- {
- new n=(numargs()-3)*4;
- if(n)
- {
- new message[128],arg_start,arg_end;
- #emit CONST.alt fstring
- #emit LCTRL 5
- #emit ADD
- #emit STOR.S.pri arg_start
- #emit LOAD.S.alt n
- #emit ADD
- #emit STOR.S.pri arg_end
- do
- {
- #emit LOAD.I
- #emit PUSH.pri
- arg_end-=4;
- #emit LOAD.S.pri arg_end
- }
- while(arg_end>arg_start);
- #emit PUSH.S fstring
- #emit PUSH.C 255
- #emit PUSH.ADR message
- n+=4*3;
- #emit PUSH.S n
- #emit SYSREQ.C format
- n+=4;
- #emit LCTRL 4
- #emit LOAD.S.alt n
- #emit ADD
- #emit SCTRL 4
- return SendClientMessage(playerid,color,message);
- }
- else return SendClientMessage(playerid,color,fstring);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement