Jump to content
  • 0

pomoc Admin příkazy if a else


dzeivi

Dotaz

Ahoj nevím si rady chci když hráč není rcon admin aby mu to napsalo že není no tady to máte :d

 
 
public OnPlayerCommandText(playerid, cmdtext[])
{
if(IsPlayerAdmin(playerid))
    if(!strcmp(cmdtext, "/adm", true))
    
    {
        ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{92e9ff}Admin Příkazy","{FF0000}Admin příkazy pouze pro rcon: {008000}/godmode", "Zavrit", "");
        return 1;
 
}
    else
    {
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{92e9ff}Admin Příkazy","{FF0000}Nejsi Rcon Admin", "Zavrit", "");
    return 1;
}
Link to comment
Share on other sites

3 odpovědí na tuto otázku

Recommended Posts

  • 0

if(!strcmp(cmdtext, "/adm", true))
{

if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{92e9ff}Admin Příkazy","{FF0000}Admin příkazy pouze pro rcon: {008000}/godmode", "Zavrit", "");
}else{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{92e9ff}Admin Příkazy","{FF0000}Nejsi Rcon Admin", "Zavrit", "");
}

return 1;
}
Link to comment
Share on other sites

  • 0

Já bych to udělal takto:

public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext, "/adm", true))
  {
      if(!IsPlayerAdmin(playerid)) return ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{92e9ff}Admin Příkazy","{FF0000}Nejsi Rcon Admin", "Zavrit", "");
      else
      {
          ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "{92e9ff}Admin Příkazy","{FF0000}Admin příkazy pouze pro rcon: {008000}/godmode", "Zavrit", "");
      }
return 1;
   }
   return 0;
}

Já to mám bez erroru a funguje mi to :d  :)

Edited by FeedBoss
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...