[How to do]When player is on dialog cant use commands
#1

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");
}
Reply
#2

Code is infront of you, what else you want?
Reply
#3

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..
Reply
#4

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.
Reply
#5

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..
Reply
#6

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;
}
Reply
#7

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.
Reply
#8

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.
Reply
#9

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..:/
Reply
#10

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;
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)