Jump to content
  • 0

pomoc Admins dialog


tomas150

Dotaz

Ahoj, takže použivám tenhle Admins dialog ale chtěl bych převest místo aby bylo v Dialogu Nick ID LVL

Tak by tam bylo Nick ID Rank

Ranky - LVL 1-2 Administrátor Dočasný LVL 3-4 Administrátor - LVL 5 Hlavní Administrátor a ještě jestli by šlo třeba Administrátor + RCON Hlavní Administrátor + RCON Ale nevim jak to udělat

 

 

// Toto je Admin online dialog by CzechBoy
// Kopírujou jen lamky! :p
// Doporučený mod: rze8
// Po případě možnost upravy
 
#include <a_samp>
#include <dini>
 
#define PLAYERS 50
 
stock udb_encode(nickname[]) {
  new tmp[MAX_STRING];
  set(tmp,nickname);
  tmp=strreplace("_","_00",tmp);
  tmp=strreplace(";","_01",tmp);
  tmp=strreplace("!","_02",tmp);
  tmp=strreplace("/","_03",tmp);
  tmp=strreplace("\\","_04",tmp);
  tmp=strreplace("[","_05",tmp);
  tmp=strreplace("]","_06",tmp);
  tmp=strreplace("?","_07",tmp);
  tmp=strreplace(".","_08",tmp);
  tmp=strreplace("*","_09",tmp);
  tmp=strreplace("<","_10",tmp);
  tmp=strreplace(">","_11",tmp);
  tmp=strreplace("{","_12",tmp);
  tmp=strreplace("}","_13",tmp);
  tmp=strreplace(" ","_14",tmp);
  tmp=strreplace("\"","_15",tmp);
  tmp=strreplace(":","_16",tmp);
  tmp=strreplace("|","_17",tmp);
  tmp=strreplace("=","_18",tmp);
  return tmp;
}
 
stock Get_Name(playerid)
{
   new pName[MAX_PLAYER_NAME];
   if(IsPlayerConnected(playerid))
   {
      GetPlayerName(playerid, pName, sizeof(pName));
   }
   return pName;
}
 
stock Get_File(playerid)
{
   new where[256];
   format(where, sizeof(where), "%s.dudb.sav", udb_encode(Get_Name(playerid)));
   return where;
}
 
stock Get_Info(playerid, what[])
{
   if(dini_Exists(Get_File(playerid)) != 0)
   {
      return dini_Bool(Get_File(playerid), what);
 
   } else { return false; }
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp("/admins", cmdtext, true, 10) == 0)
   {
      new stringa[256];
        new string[1300];
 
       new admin_cca = 0;
      for(new i=0; i<PLAYERS; i++)
      {
         if(IsPlayerConnected(i))
         {
             if(Get_Info(i, "adminlvl") > 0)
             {
                  format(stringa,sizeof(stringa),"%s (ID: %d) - LVL: %d\n", Get_Name(i), i, Get_Info(i, "adminlvl"));
                  strcat(string,stringa);
               admin_cca ++;
            }
         }
       }
       if(admin_cca < 1) { string = "Na serveru není žádný online administrátor"; }
       ShowPlayerDialog(playerid,2000,DIALOG_STYLE_MSGBOX,"{37DB45}Online Administrátoři",string,"Zavřít","");
        return 1;
   }
   return 0;
}

Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0

~> Změň si includ na práci s ukládáním údajů. A jen tak mimochodem:

 

 

 

public OnPlayerCommandText(playerid, cmdtext[]) {

    if (!strcmp("/admins", cmdtext)) { 

        new 
            sString[600],
            bool: bIsOnline;
        for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) {

            if (Get_Info(i, "adminlvl") > 0) {

                format(sString, sizeof(sString),"%s\n%s (ID: %d) - LVL: %d\n", sString, Get_Name(i), i, Get_Info(i, "adminlvl"));
                bIsOnline = (true);
            }
        }
        if (!bIsOnline) sString = "Na serveru není žádný online administrátor"; 
        ShowPlayerDialog(playerid, 2000, DIALOG_STYLE_MSGBOX,"{37DB45}Online Administrátoři", sString, "Zavrit", "");
        return true;
    }
   return (false);
}

 

Link to comment
Share on other sites

  • 0

~> Nezkusil. Nemusíš zbytečně lhát. Jen sis to našel + k tomu jsi si ještě přidal funkci z eXisu, o které také určitě nic nevíš. A to třetice ti to povím znova, proč to varování:

 

~> Protože nikde nemáš preprocesor na QCMD. Nebo includ. Nebo cokoliv, tak to bere jako funkci, a říká ti, že jsi tu funkci nikde nevyužil.

 

~> Akorát tady místo QCMD tam máš ještě horší a to dcmd...

Link to comment
Share on other sites

  • 0

a jak to mám opravit?

Hele omlouvám se nevěděl jsem že vtom je eXis ale chtěl sem si to udělat takhle jak je to na tomto serveru

http://www.img.tpx.cz/uploads/howtoadmins.png

lock

Velká pařba má tohle: http://www.sampsko.hys.cz/viewtopic.php?f=23&t=118. Otevři pawn editor, udělej CTRL + C, CTRL + V a F5. Je to shit, ale pokud máš RZE8, tak ti to fungovat bude.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...