Question

archiboy6
Гуру форума

Как сделать чтобы писало звание админов в admins? Например, Руководитель 

CMD:admins(playerid, params[])
{
	if(Login[playerid] == 0) return true;
	SCM(playerid, 0x99CC00FF, "Админы онлайн:");
	foreach(Player, i)
	{
	    if(IsPlayerConnected(i))
	    {
	        if(PInfo[i][pAdmin] != 0)
	        {
	            if(plafk[i] >= 5)
				{
					format(Text, 144, "%s[%d] (%d lvl) - {FF0000}AFK [%s]", PInfo[i][pName], i, PInfo[i][pAdmin], Converts(plafk[i])),SCM(playerid, 0xFFFF00AA, Text);
				}
				else format(Text, 144, "%s[%d] (%d lvl)", PInfo[i][pName], i, PInfo[i][pAdmin]), SCM(playerid, 0xFFFF00AA, Text);
			}
		}
	}
	return true;
}

Вот звания сами.

		new atext[32];
		switch(PInfo[playerid][pAdmin])
		{
			case 1:	atext = "Агент Поддержки";
			case 2:	atext = "Мл.Администратор";
			case 3:	atext = "Администратор";
			case 4: atext = "Зам.ГА";
			case 5: atext = "Главный Администратор";
			case 6: atext = "Руководитель";
			
		}

 

Share this post


Link to post

8 answers to this question

  • 0
Guest
Новичок

@Didar зачем тут звания администратора? Если тут отображается лвл

А так со званиями:
 

Спойлер

CMD:admins(playerid, params[])
{
	if(Login[playerid] == 0) return true;
	SCM(playerid, 0x99CC00FF, "Админы онлайн:");
	foreach(Player, i)
	{
	    if(IsPlayerConnected(i))
	    {
	        if(PInfo[i][pAdmin] != 0)
	        {
              	static const Admin_Names[6][32] = {"Агент Поддержки","Мл.Администратор","Администратор","Зам.ГА","Главный Администратор","Руководитель"};
	            if(plafk[i] >= 5)
				{
					format(Text, 144, "%s %s[%d] (%d lvl) - {FF0000}AFK [%s]", Admin_Names[PInfo[playerid][pAdmin]-1], PInfo[i][pName], i, PInfo[i][pAdmin], Converts(plafk[i])),SCM(playerid, 0xFFFF00AA, Text);
				}
				else format(Text, 144, "%s %s[%d] (%d lvl)", Admin_Names[PInfo[playerid][pAdmin]-1], PInfo[i][pName], i, PInfo[i][pAdmin]), SCM(playerid, 0xFFFF00AA, Text);
			}
		}
	}
	return true;
}

 

 

Share this post


Link to post
  • 0
Didar
Новичок
Попробуй вот так =)


CMD:admins(playerid, params[])
{
    if(Login[playerid] == 0) return true;
    SCM(playerid, 0x99CC00FF, "Админы онлайн:");
    foreach(Player, i)
    {
        if(IsPlayerConnected(i))
        {
            if(PInfo[i][pAdmin] != 0)
            {
                if(plafk[i] >= 5)
                {
                    format(Text, 144, "%s[%d], %s, (%d lvl) - {FF0000}AFK [%s]", PInfo[i][pName], i, atext, PInfo[i][pAdmin], Converts(plafk[i])),SCM(playerid, 0xFFFF00AA, Text);
                }
                else format(Text, 144, "%s[%d], %s, (%d lvl)", PInfo[i][pName], i, atext, PInfo[i][pAdmin]), SCM(playerid, 0xFFFF00AA, Text);
            }
        }
    }
    return true;
}

Заметка от Guest , создано

3.2. Код больше 10 строк брать еще и под спойлер

Share this post


Link to post
  • 0
archiboy6
Гуру форума

@Didar на atext ругается 

C:\Users\Ðîìà\Desktop\ZM\gamemodes\zm.pwn(10208) : error 017: undefined symbol "atext"
C:\Users\Ðîìà\Desktop\ZM\gamemodes\zm.pwn(10210) : error 017: undefined symbol "atext"

 

Share this post


Link to post
  • 0
kusehsup
Постоянный
1 час назад, archiboy6 сказал:

@Didar на atext ругается 


C:\Users\Ðîìà\Desktop\ZM\gamemodes\zm.pwn(10208) : error 017: undefined symbol "atext"
C:\Users\Ðîìà\Desktop\ZM\gamemodes\zm.pwn(10210) : error 017: undefined symbol "atext"

 

Ну так объяви переменную atext и свитч с названиями.

кажись так..

CMD:admins(playerid, params[])
{
    if(Login[playerid] == 0) return true;
  	new atext[32];
	switch(PInfo[playerid][pAdmin])
	{
			case 1:	atext = "Агент Поддержки";
			case 2:	atext = "Мл.Администратор";
			case 3:	atext = "Администратор";
			case 4: atext = "Зам.ГА";
			case 5: atext = "Главный Администратор";
			case 6: atext = "Руководитель";
			
	}
    SCM(playerid, 0x99CC00FF, "Админы онлайн:");
    foreach(Player, i)
    {
        if(IsPlayerConnected(i))
        {
            if(PInfo[i][pAdmin] != 0)
            {
                if(plafk[i] >= 5)
                {
                    format(Text, 144, "%s[%d], %s, (%d lvl) - {FF0000}AFK [%s]", PInfo[i][pName], i, atext, PInfo[i][pAdmin], Converts(plafk[i])),SCM(playerid, 0xFFFF00AA, Text);
                }
                else format(Text, 144, "%s[%d], %s, (%d lvl)", PInfo[i][pName], i, atext, PInfo[i][pAdmin]), SCM(playerid, 0xFFFF00AA, Text);
            }
        }
    }
    return true;
}

p/s не уверен

Если все норм, табуляцию поправь, дабы варнингов не было

Edited by DEST

Share this post


Link to post
  • 0
archiboy6
Гуру форума

@Aurum Работает но почему то всем пишет Руководитель всем лвлам

Share this post


Link to post
  • 0
Didar
Новичок
6 часов назад, Jaliba Baron сказал:

@Didar зачем тут звания администратора? Если тут отображается лвл

А так со званиями:
 

  Клик (открыть спойлер)


CMD:admins(playerid, params[])
{
	if(Login[playerid] == 0) return true;
	SCM(playerid, 0x99CC00FF, "Админы онлайн:");
	foreach(Player, i)
	{
	    if(IsPlayerConnected(i))
	    {
	        if(PInfo[i][pAdmin] != 0)
	        {
              	static const Admin_Names[6][32] = {"Агент Поддержки","Мл.Администратор","Администратор","Зам.ГА","Главный Администратор","Руководитель"};
	            if(plafk[i] >= 5)
				{
					format(Text, 144, "%s %s[%d] (%d lvl) - {FF0000}AFK [%s]", Admin_Names[PInfo[playerid][pAdmin]-1], PInfo[i][pName], i, PInfo[i][pAdmin], Converts(plafk[i])),SCM(playerid, 0xFFFF00AA, Text);
				}
				else format(Text, 144, "%s %s[%d] (%d lvl)", Admin_Names[PInfo[playerid][pAdmin]-1], PInfo[i][pName], i, PInfo[i][pAdmin]), SCM(playerid, 0xFFFF00AA, Text);
			}
		}
	}
	return true;
}

 

 

ну не знаю, у него спроси.. Может типа так будет легче узнать кто какой уровень админа =)

Share this post


Link to post
  • 0
Guest
Новичок

@Didar так проще выстроить схему
 

Пример: Администратор Jaliba_Baron[ID] - LVL 5

На деле:
	        if(PInfo[i][pAdmin] != 0)
	        {
              	static const Admin_Names[6][32] = {"Агент Поддержки","Мл.Администратор","Администратор","Зам.ГА","Главный Администратор","Руководитель"};
	            if(plafk[i] >= 5)
				{
					format(Text, 144, "%s %s[%d] - LVL %d (AFK %s)", Admin_Names[PInfo[playerid][pAdmin]-1], PInfo[i][pName], i, PInfo[i][pAdmin], Converts(plafk[i])),SCM(playerid, 0xFFFF00AA, Text);
				}
				else format(Text, 144, "%s %s[%d] - LVL %d", Admin_Names[PInfo[playerid][pAdmin]-1], PInfo[i][pName], i, PInfo[i][pAdmin]), SCM(playerid, 0xFFFF00AA, Text);
			}
		}

 

Share this post


Link to post
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • grizly57a
      By grizly57a
      1 захожу на сервер и не мой хост хотя в сервер коннекте я указал все свое
      2 выкидывает через секунду
      3 пишет Loading filterscript 'voice.amx'...
      [15:50:18] No collision data found.

      ----------
      Loaded log file: "server_log.txt".
      ----------
      SA-MP Dedicated Server
      ----------------------
      v0.3.7-R2, (C)2005-2015 SA-MP Team
      [15:50:16] weburl = "www.sa-mp.com"  (string)
      [15:50:16] 
      [15:50:16] Server Plugins
      [15:50:16] --------------
      [15:50:16]  Loading plugin: crashdetect.so
      [15:50:16]   CrashDetect plugin 4.19.4
      [15:50:16]   Loaded.
      [15:50:16]  Loading plugin: pawncmd.so
      [15:50:17] Pawn.CMD plugin v3.2.0 by urShadow has been loaded
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: pawnraknet.so
      [15:50:17] [Pawn.RakNet] plugin v1.6.0 loading...
      [15:50:17] [Pawn.RakNet] 
          | Pawn.RakNet 1.6.0 | 2016 - 2023
          |--------------------------------
          | Author and maintainer: katursis

          | Compiled: Feb 12 2023 at 19:35:06
          |--------------------------------------------------------------
          | Repository: https://github.com/katursis/Pawn.RakNet
          |--------------------------------------------------------------
          | Wiki: https://github.com/katursis/Pawn.RakNet/wiki
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: sscanf.so
      [15:50:17] 
      [15:50:17]  ===============================
      [15:50:17]       sscanf plugin loaded.     
      [15:50:17]          Version:  2.8.3        
      [15:50:17]   (c) 2018 Alex "Y_Less" Cole  
      [15:50:17]  ===============================
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: streamer.so
      [15:50:17] 
      *** Streamer Plugin v2.9.6 by Incognito loaded ***
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: mysql_static.so
      [15:50:17]  >> plugin.mysql: R39-6 successfully loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: TOTP.so
      [15:50:17] TOTP plugin v1.0.1 by Games loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: profiler.so
      [15:50:17]   Profiler plugin 2.15.1
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: timerfix.so
      [15:50:17]   >> TimerFix v1.5 successfully loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: UTuning.so
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: housecar.so
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: TOTP.so
      [15:50:17] TOTP plugin v1.0.1 by Games loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: FCNPC.so
      [15:50:17] 
      [15:50:17] -------------------------------------------------
      [15:50:17]      FCNPC - Fully Controllable NPC v2.0.11
      [15:50:17]             GNU/Linux SA-MP 0.3.7 R2
      [15:50:17]            Aug 23 2024 at 16:35:48
      [15:50:17] 
      [15:50:17]   Author:       OrMisicL (2013 - 2015)
      [15:50:17]   Continued by: ziggi    (2016 - present)
      [15:50:17] 
      [15:50:17]   See full credits in the README.md file
      [15:50:17] -------------------------------------------------
      [15:50:17] 
      [15:50:17] Loading...
      [15:50:17] 
      [15:50:17] -------------------------------------------------
      [15:50:17]    ColAndreasv1.4.0
      [15:50:17] 
      [15:50:17]    Created By:
      [15:50:17]      [uL]Chris42O
      [15:50:17]      [uL]Slice
      [15:50:17]      [uL]Pottus
      [15:50:17] -------------------------------------------------
      [15:50:17] 
      [15:50:17] Loading...
      [15:50:17] ColAndreas v1.4.0 Loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loaded 13 plugins.
      [15:50:17] 
      [15:50:17] Filterscripts
      [15:50:17] ---------------
      [15:50:17]   Loading filterscript 'voice.amx'...
      [15:50:18] No collision data found.
      [15:50:18] 
      --------------------------------------
      [15:50:18]    VOICE COPY RADMIR BY Маттео dev.    
      [15:50:18] --------------------------------------
      [15:50:18]   Loaded 1 filterscripts.
      [15:50:20] ------------------------------------------
      [15:50:20]                  MELONITY AC                 
      [15:50:20] ------------------------------------------
      [15:50:20] weburl = "www.sa-mp.com"  (string)
      [15:50:20] [Vehicle]: Все транспортные средства созданы
      [15:50:20] [TP]: Все входы/выходы созданы
      [15:50:20] [ATM]: Все банкоматы созданы
      [15:50:20] Подключение к базе данных не удалось [Неизвестная ошибка. Код ошибки: -1]
      [15:50:20] -----------------------------------------
      [15:50:20]                                          
      [15:50:20]        CanVas Dev
      [15:50:20]                                          
      [15:50:20] -----------------------------------------
      [15:50:20] Number of vehicle models: 38
      [16:00:35] [connection] 93.159.241.195:1523 requests connection cookie.
      [16:00:36] [connection] incoming connection: 93.159.241.195:1523 id: 0
      [16:00:36] [join] Whoole_Daadadw has joined the server (0:93.159.241.195)
      [16:00:36] [part] Whoole_Daadadw has left the server (0:2)