SA-MP Forums Archive
[Help] mod chat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] mod chat (/showthread.php?tid=68152)



[Help] mod chat - linxx - 07.03.2009

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;
	}



Re: [Help] mod chat - Synkro93 - 07.03.2009

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




Re: [Help] mod chat - saiberfun - 07.03.2009

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


Re: [Help] mod chat - linxx - 07.03.2009

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?


Re: [Help] mod chat - Synkro93 - 10.03.2009

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


Re: [Help] mod chat - MenaceX^ - 10.03.2009

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.