[How to do]When player is on dialog cant use commands -
Connor Smith - 27.05.2014
How to do this?
Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
{
ShowPlayerDialog(playerid, 137, DIALOG_STYLE_INPUT,"Administrator panel","Insert the PIN of Administrator panel!","Insert","Disconnect");
}
Re: [How to do]When player is on dialog cant use commands -
Parallex - 27.05.2014
Code is infront of you, what else you want?
Re: [How to do]When player is on dialog cant use commands -
Connor Smith - 27.05.2014
Quote:
Originally Posted by BenJackster
Code is infront of you, what else you want?
|
I need to do when this dialog appears the player can not use commands..
Re: [How to do]When player is on dialog cant use commands -
Parallex - 27.05.2014
Oh, so if they press "Esc" to cancel the dialog, it will kick the player - that's what you want?
Well, if so, then go to OnDialogResponse
pawn Код:
if(dialogid == 137) // Correct me if I am not wrong with the Dialog ID.
{
if(!response) // If they cancel the dialog.
{
SendClientMessage(playerid,xFF0000AA,"You failed to put the Administration PIN. In result, you are being kicked."); // Send them the message that why are they getting kicked.
Kick(playerid); // Kick them as they failed to put the Administration PIN.
return 1;
}
P.S: Sorry for the bad Identations, just did that here.
Re: [How to do]When player is on dialog cant use commands -
Connor Smith - 27.05.2014
Quote:
Originally Posted by BenJackster
Oh, so if they press "Esc" to cancel the dialog, it will kick the player - that's what you want?
Well, if so, then go to OnDialogResponse
pawn Код:
if(dialogid == DIALOG_137) { if(!response) { SendClientMessage(playerid,xFF0000AA,"You failed to put the Administration PIN. In result, you are being kicked."); Kick(playerid) return 1; } if(response) { // Rest of your code and functions over here.
P.S: Sorry for the bad Identations, just did that here.
|
No bro i did this already listen, U know that bug with F6? U press F6 use some command and dialog close..I need that if u got me now? 
EDIT:
Код:
if(gPlayerSpawned[playerid] == 0)
{
SendClientMessage(playerid, WHITE, "{FF4040}ERROR:{FFFFFF}Can not use commands right now.");
return 1;
}
Like this..
Re: [How to do]When player is on dialog cant use commands -
Face9000 - 27.05.2014
pawn Код:
new PuttingAdminPin[MAX_PLAYERS];
In the dialog cmd, after ShowDialog:
pawn Код:
PuttingAdminPin[playerid] = 1;
To stop using commands:
pawn Код:
if(PuttingAdminPin[playerid] == 1)
{
SendClientMessage(playerid, WHITE, "{FF4040}ERROR:{FFFFFF}Can not use commands right now.");
return 1;
}
Re: [How to do]When player is on dialog cant use commands -
iFiras - 27.05.2014
Quote:
Originally Posted by Face9000
pawn Код:
new PuttingAdminPin[MAX_PLAYERS];
In the dialog cmd, after ShowDialog:
pawn Код:
PuttingAdminPin[playerid] = 1;
To stop using commands:
pawn Код:
if(PuttingAdminPin[playerid] == 1) { SendClientMessage(playerid, WHITE, "{FF4040}ERROR:{FFFFFF}Can not use commands right now."); return 1; }
|
After creating variables and etc. You need to do that:
pawn Код:
if(PuttingAdminPin[playerid] == 1)
{
SendClientMessage(playerid, WHITE, "{FF4040}ERROR:{FFFFFF}Can not use commands right now.");
return 1;
}
under OnPlayerCommandText.
Correct me if I'm wrong.
Re: [How to do]When player is on dialog cant use commands -
Konstantinos - 27.05.2014
Unless he uses ZCMD and it can be in OnPlayerCommandReceived callback (returning 0 there, it won't perform the command).
By the way, don't forget to reset the variable on connect and when the player closes the dialog.
Re: [How to do]When player is on dialog cant use commands -
Connor Smith - 28.05.2014
Quote:
Originally Posted by iFiras
After creating variables and etc. You need to do that:
pawn Код:
if(PuttingAdminPin[playerid] == 1) { SendClientMessage(playerid, WHITE, "{FF4040}ERROR:{FFFFFF}Can not use commands right now."); return 1; }
under OnPlayerCommandText.
Correct me if I'm wrong.
|
Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
{
ShowPlayerDialog(playerid, 137, DIALOG_STYLE_INPUT,"Administrator panel","Insert the PIN of Administrator panel!","Insert","Disconnect");
PuttingAdminPin[playerid] = 1;
}
Now I cant use any command..:/
Re: [How to do]When player is on dialog cant use commands -
Parallex - 28.05.2014
Quote:
Originally Posted by Connor Smith
Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
{
ShowPlayerDialog(playerid, 137, DIALOG_STYLE_INPUT,"Administrator panel","Insert the PIN of Administrator panel!","Insert","Disconnect");
PuttingAdminPin[playerid] = 1;
}
Now I cant use any command..:/
|
Go to the function that happens when you have typed the right Administration PIN and type there
pawn Код:
PuttingAdminPin[playerid] = 0;