Any ideas? -
Tass007 - 25.08.2012
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?
Re: Any ideas? -
ddnbb - 25.08.2012
Make a variable like
...then make a command which show's a dialog to the player;
https://sampwiki.blast.hk/wiki/ShowPlayerDialog ...
...then under OnDialogResponse, check if the players input is that "new password", if it is, give him admin rights etc...
Hope this helps!
Re: Any ideas? -
SupaVZ - 25.08.2012
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.
Re: Any ideas? -
ddnbb - 25.08.2012
Quote:
Originally Posted by Dean_Nelson
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.
|
This haves NOTHING to do what OP asked for... And stop begging reps. -.-
Re: Any ideas? -
Akira297 - 25.08.2012
Was this request solved?
Re: Any ideas? -
Shetch - 25.08.2012
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.
Re: Any ideas? -
ddnbb - 25.08.2012
Quote:
Originally Posted by Shetch
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.
Re: Any ideas? -
Lordzy - 25.08.2012
Example
pawn Code:
new pass = 1234;//Create a password variable to password this in your command.
wiki.sa-mp.com/wiki/OnDialogResponse
Here you'll get an idea to create your /god command.
Im sorry for not explaining how to do this because Im now using forums in mobile,so I dont know whether Im typing correct or not.
Re: Any ideas? -
Shetch - 25.08.2012
Quote:
Originally Posted by ddnbb
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. 
|
Each person has their own style of scripting I guess.
I just like it better that way.
Re: Any ideas? -
ddnbb - 25.08.2012
Quote:
Originally Posted by Shetch
Each person has their own style of scripting I guess.
I just like it better that way.
|
Thats for sure. But makes me wonder why would someone like to make useless few lines of script.