Any ideas?
#7

Quote:
Originally Posted by Shetch
View Post
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;
}
Haven't tested it, but you get the idea.
Sorry but i have to bully you for your style of making dialogs. Whats with the "if(!response)", you can just remove the '!' and continue your script there, no 'else' needed. Bwah.
Reply


Messages In This Thread
Any ideas? - by Tass007 - 25.08.2012, 00:54
Re: Any ideas? - by ddnbb - 25.08.2012, 02:25
Re: Any ideas? - by SupaVZ - 25.08.2012, 02:48
Re: Any ideas? - by ddnbb - 25.08.2012, 02:52
Re: Any ideas? - by Akira297 - 25.08.2012, 03:07
Re: Any ideas? - by Shetch - 25.08.2012, 03:16
Re: Any ideas? - by ddnbb - 25.08.2012, 03:21
Re: Any ideas? - by Lordzy - 25.08.2012, 03:28
Re: Any ideas? - by Shetch - 25.08.2012, 03:31
Re: Any ideas? - by ddnbb - 25.08.2012, 04:41

Forum Jump:


Users browsing this thread: 1 Guest(s)