25.08.2012, 00:54
Hello, i want to create a command that when i type /makemegod it pops up with a dialog and you need to insert a pass like 2413 and it will give you 9999 admin level any ideas?
new password = 2413;
Hmm, why dont you make a commands like /god, instead of doing /makemegod. I'll give you this
CMD:god(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { SetPlayerHealth(playerid, 100000); SetPlayerArmour(playerid, 100000); } return 1; } If i helped you. Please give me reps, thanks. |
new pass[32] = "36543532";
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/makemegod", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid, 334, DIALOG_STYLE_INPUT, "Admin", "Enter the password below:", "Accept", "Cancel"); return 1; } return 0; }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 334) { if(!response) { return 1; } else { if(strcmp(inputtext, pass, true)) { SendClientMessage(playerid, COLOR_RED, "Wrong password!"); return 1; } PlayerInfo[playerid][Admin] = 9999; // Change this to whatever defines your admin level. } } return 1; }
Code:
new pass[32] = "36543532"; Code:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/makemegod", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid, 334, DIALOG_STYLE_INPUT, "Admin", "Enter the password below:", "Accept", "Cancel"); return 1; } return 0; } Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 334) { if(!response) { return 1; } else { if(strcmp(inputtext, pass, true)) { SendClientMessage(playerid, COLOR_RED, "Wrong password!"); return 1; } PlayerInfo[playerid][Admin] = 9999; // Change this to whatever defines your admin level. } } return 1; } |
new pass = 1234;//Create a password variable to password this in your command.