Admin Chat Issue
#1

Код:
	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[96];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/a)dmin [admin chat]");
				return 1;
			}
			new atext[60];
			if(PlayerInfo[playerid][pAdmin] == 1){ atext = "Trial Admin"; }
			if(PlayerInfo[playerid][pAdmin] == 2){ atext = "Administrator"; }
			if(PlayerInfo[playerid][pAdmin] == 3){ atext = "Senior Admin"; }
			if(PlayerInfo[playerid][pAdmin] == 4){ atext = "NOT USED"; }
			if(PlayerInfo[playerid][pAdmin] == 1337){ atext = "Head Admin"; }
			if(PlayerInfo[playerid][pAdmin] == 1338){ atext = "Server Owner"; }
			if(PlayerInfo[playerid][pAdmin] == 1339){ atext = "NOT USED"; }
			if(PlayerInfo[playerid][pAdmin] == 99999) { atext = "NOT USED"; }
		    format(string, sizeof(string), "%s %s:"COL_WHITE "%s", atext, RemoveUnderScore(playerid), playerid, result);
		    SendClientMessage(playerid, COLOR_WHITE, string);
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendAdminMessage(COLOR_ORANGE, string);
			}
		}
		return 1;
	}
This is my code for admin chat and whenever I speak in /a, it looks like this. Does anyone know how to resolve this?

http://prntscr.com/1wsshv
Reply
#2

Show me the show pictures of your problem.And what you exactly need.
Reply
#3

The chat always appears to be the letter 'a' with the colon on top of it, no matter what I type.
Reply
#4

Quote:
Originally Posted by Joshswag
Посмотреть сообщение
The chat always appears to be the letter 'a' with the colon on top of it, no matter what I type.
Wait i'll test it...
Reply
#5

Bump, issue is still not resolved and I can't find the problem.
Reply
#6

Quote:
Originally Posted by Joshswag
Посмотреть сообщение
Bump, issue is still not resolved and I can't find the problem.
Try changing
Код:
format(string, sizeof(string), "%s %s:"COL_WHITE "%s", atext, RemoveUnderScore(playerid), playerid, result);
to

Код:
new PLAYER_NAME[MAX_PLAYER_NAME];
GetPlayerName(playerid, PLAYER_NAME, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s %s: "COL_WHITE"%s", atext, PLAYER_NAME, result);
Reply
#7

Worked, repped.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)