Please help Admin Chat
#1

A little Help When i Make Myself 7level admin it Writes Con.But it should write S.Scripter


Код:
if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/a)dmin [admin chat]");
				return 1;
			}
      if (PlayerInfo[playerid][pAdmin] >= 1)
			{
      format(string, sizeof(string), "* Adminas[Con.] %s: %s" , sendername, result);
			}
			else if (PlayerInfo[playerid][pAdmin] >= 2)
			{
      format(string, sizeof(string), "* Adminas[Mod.] %s: %s" , sendername, result);
			}
			else if (PlayerInfo[playerid][pAdmin] >= 3)
			{
      format(string, sizeof(string), "* Adminas[S.Mod.] %s: %s" , sendername, result);
			}
			else if (PlayerInfo[playerid][pAdmin] >= 4)
			{
      format(string, sizeof(string), "* Adminas[Admin.] %s: %s" , sendername, result);
			}
			else if (PlayerInfo[playerid][pAdmin] >= 5)
			{
      format(string, sizeof(string), "* Adminas[S.Admin] %s: %s" , sendername, result);
			}
      else if (PlayerInfo[playerid][pAdmin] >= 6)
			{
      format(string, sizeof(string), "* Adminas[Scripter] %s: %s" , sendername, result);
			}
      else if (PlayerInfo[playerid][pAdmin] >= 7)
			{
      format(string, sizeof(string), "* Adminas[S.Scripter] %s: %s" , sendername, result);
			}
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendAdminMessage(COLOR_LIGHTGREEN, string);
			}
			printf("Admin %s: %s", sendername, result);
  	}
  return 1;
	}
Reply
#2

Quote:
Originally Posted by wordas
A little Help When i Make Myself 7level admin it Writes Con.But it should write S.Scripter


Код:
if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/a)dmin [admin chat]");
				return 1;
			}
      if (PlayerInfo[playerid][pAdmin] >= 1)
			{
      format(string, sizeof(string), "* Adminas[Con.] %s: %s" , sendername, result);
			}
			else if (PlayerInfo[playerid][pAdmin] >= 2)
			{
      format(string, sizeof(string), "* Adminas[Mod.] %s: %s" , sendername, result);
			}
			else if (PlayerInfo[playerid][pAdmin] >= 3)
			{
      format(string, sizeof(string), "* Adminas[S.Mod.] %s: %s" , sendername, result);
			}
			else if (PlayerInfo[playerid][pAdmin] >= 4)
			{
      format(string, sizeof(string), "* Adminas[Admin.] %s: %s" , sendername, result);
			}
			else if (PlayerInfo[playerid][pAdmin] >= 5)
			{
      format(string, sizeof(string), "* Adminas[S.Admin] %s: %s" , sendername, result);
			}
      else if (PlayerInfo[playerid][pAdmin] >= 6)
			{
      format(string, sizeof(string), "* Adminas[Scripter] %s: %s" , sendername, result);
			}
      else if (PlayerInfo[playerid][pAdmin] >= 7)
			{
      format(string, sizeof(string), "* Adminas[S.Scripter] %s: %s" , sendername, result);
			}
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendAdminMessage(COLOR_LIGHTGREEN, string);
			}
			printf("Admin %s: %s", sendername, result);
  	}
  return 1;
	}
you made it like if your higher than 1 or are 1 your Con, just replace >= with ==
Reply
#3

Thanks
Reply
#4

Quote:
Originally Posted by wordas
Thanks
np
Reply
#5

Owh sorry it works fine! thanks agen !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)