SA-MP Forums Archive
[HELP] /cnnn [FORMAT] [TEXT] - 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] /cnnn [FORMAT] [TEXT] (/showthread.php?tid=143301)



[HELP] /cnnn [FORMAT] [TEXT] - andershh - 22.04.2010

Im trying to get another format with /cnnn. Like this etc,
Quote:

/cnnn ~w~ (Text)

But i always got the same format, whatever format i use.
I can only change Formats useing this command :
Код:
GameTextForPlayer(playerid, "~w~ Drive Safetly", 10000, 4);
How can i make it work with /cnnn to get something like this?




Re: [HELP] /cnnn [FORMAT] [TEXT] - Tr1viUm - 22.04.2010

Do you mean this?

Код:
if (strcmp("/cnnn", cmdtext, true, 5) == 0)
{
	if(cmdtext[5] == EOS || cmdtext[6] == EOS)
		return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /cnnn [text]");

     GameTextForAll(cmdtext[6], 10000, 4);
	return 1;
}



Re: [HELP] /cnnn [FORMAT] [TEXT] - andershh - 22.04.2010

Yeah i got the command but i cant change the formats of it.

Код:
if(strcmp(cmd, "/cnnn", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (PlayerInfo[playerid][pAdmin] >= 2)
			{
				tmp = strtok(cmdtext, idx);
				new txtid;
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /cnnn <type> ");
					return 1;
				}
				txtid = strval(tmp);
				if(txtid == 2)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "You can not select 2");
					return 1;
				}
				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: /cnnn <type> [cnnc textformat ~n~=Newline ~r~=Red ~g~=Green ~b~=Blue ~w~=White ~y~=Yellow]");
					return 1;
				}
				format(string, sizeof(string), "~w~%s",result);
				for(i = 0; i < MAX_PLAYERS; i++)
				{
					if(IsPlayerConnected(i) == 1)
					{
						GameTextForPlayer(i, string, 5000, txtid);
					}
				}
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");
				return 1;
			}
		}
		return 1;