Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #define DIALOG_FIRST 1
- #define DIALOG_SECOND 2
- CMD:activatename(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- ShowPlayerDialog(playerid,DIALOG_FIRST,DIALOG_STYLE_MSGBOX,"{FF0000}Activate","Hello, and Welcome to {15FF00}HY {FF0000}Hostname {FFFF00}Changer\n\n{FFFFFF}Are you sure you want to change your server's name ?\n\nIf {15FF00}Yes {FFFFFF}, write {FF0000}/CHostname {FFFFFF},else click {15FF00}Exit {FFFFFF}!","","Exit");
- }
- else
- {
- SendClientMessage(playerid,-1, "{FF0000}ERROR: {15FF00}This command can be used only by {FF0000}RCON {15FF00}!");
- }
- return 1;
- }
- CMD:chostname(playerid,params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- ShowPlayerDialog(playerid,DIALOG_SECOND,DIALOG_STYLE_MSGBOX,"{FF0000}Succesfully","You have {15FF00}succesfully {FFFFFF}changed your hostname with {FF0000}HY's {FFFF00}Hostname {0066CC}Changer\n\n{FFFFFF}Thanks because you used this {FF0000}Filescript {FFFFFF}!","Exit","");
- SetTimer("Changer", 3000, true);
- SendClientMessage(playerid,-1, "{FF0000}You have succesfully changed your {15FF00}Server's Name{FFFFFF} by using {FF0000}HY's Hostname Changer.");
- SendClientMessage(playerid,-1, "{FF0000}Please check if this {15FF00}REALLY WORKS !");
- }
- else
- {
- SendClientMessage(playerid,-1, "{FF0000}ERROR: {15FF00}This command can be used only by {FF0000}RCON {15FF00}!");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_FIRST)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid,-1, "{FF0000}You have succesfully changed your {15FF00}Server's Name{FFFFFF} by using {FF0000}HY's Hostname Changer.");
- SendClientMessage(playerid,-1, "{FF0000}Please check if this {15FF00}REALLY WORKS !");
- SetTimer("Changer", 3000, true);
- }
- }
- }
- return 0;
- }
- public OnGameModeInit()
- {
- SetTimer("Changer", 3000, false);
- }
- forward Changer();
- public Changer()
- {
- new var = random(4);
- switch (var)
- {
- case 0: SendRconCommand("hostname » FIRST HOSTNAME « | • #1 •");
- case 1: SendRconCommand("hostname » SECOND HOSTNAME « | • #2 •");
- case 2: SendRconCommand("hostname » THIRD HOSTNAME « | • #3 •");
- case 3: SendRconCommand("hostname » FOURTH HOSTNAME « | • #4 •");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment