Admin Chat Problem
#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] == 1337){ atext = "Head Admin"; }
			if(PlayerInfo[playerid][pAdmin] == 1338){ atext = "Server Owner"; }
		    format(string, sizeof(string), "%s %s:"COL_WHITE "%s", atext, RemoveUnderScore(playerid), playerid, result);
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendAdminMessage(COLOR_ORANGE, string);
			}
		}
		return 1;
	}
Here is the code for my administrator chat, although I'm having an issue with the text appearing. It appears as either a comma or just not appearing t all. So it would be like 'Server Owner Josh:'. I don't get any errors, anyone know the problem?
Reply


Messages In This Thread
Admin Chat Problem - by Joshswag - 14.08.2013, 05:30
Re: Admin Chat Problem - by ThaCrypte - 14.08.2013, 05:47
Re: Admin Chat Problem - by Joshswag - 14.08.2013, 06:05
Re: Admin Chat Problem - by dEcooR - 14.08.2013, 09:05
Re: Admin Chat Problem - by NinjahZ - 14.08.2013, 10:05
Re: Admin Chat Problem - by Vanter - 14.08.2013, 10:51
Re: Admin Chat Problem - by Mike_Peterson - 14.08.2013, 11:36

Forum Jump:


Users browsing this thread: 1 Guest(s)