[Help] mod chat
#1

Hello all i have made a very simple mod chat for moderators but the problem im having is that they can type but they can't see there txt or anyone elses txt, have you any idea why this is?? regards kry
Код:
	if(strcmp(cmd, "/mc", true) == 0 || strcmp(cmd, "/modchat", 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: (/mc [Modchat]");
				return 1;
			}
			format(string, sizeof(string), "*%d Moderator %s: %s", PlayerInfo[playerid][pGameMaster], sendername, result);
			if (PlayerInfo[playerid][pGameMaster] >= 1)
			{
				SendAdminMessage(COLOR_DBLUE, string);
			}
			printf("Moderator %s: %s", sendername, result);
		}
		return 1;
	}
Reply
#2

What's the problem then?

Quote:

Hello all i have made a very simple mod chat for moderators but the problem im having is that they can type but they can see there txt or anyone elses txt, have you any idea why this is?? regards kry

Reply
#3

it shows it in usual and the modded way?
if yea then just return 0;
Reply
#4

soz that was a typo what i ment to say is they can type but cant see any of the mod text no can any of the mods?
Reply
#5

Quote:
Originally Posted by saiberfun
it shows it in usual and the modded way?
if yea then just return 0;
Didn't that help?
Reply
#6

A correct code.
Код:
	if(strcmp(cmd, "/mc", true) == 0 || strcmp(cmd, "/modchat", 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: (/mc [Modchat]");
				return 1;
			}
			format(string, sizeof(string), "*%d Moderator %s: %s", PlayerInfo[playerid][pGameMaster], sendername, result);
             for(new i=0;i<MAX_PLAYERS;i++)
			if (PlayerInfo[i][pGameMaster] >= 1)
			{
				SendAdminMessage(i,COLOR_DBLUE, string);
			}
			printf("Moderator %s: %s", sendername, result);
		}
		return 1;
	}
Probably identation is screwed up. I've no clue what happened with the identatiation.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)