SA-MP Forums Archive
Help with making text longer - 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 with making text longer (/showthread.php?tid=116987)



Help with making text longer - Guso - 30.12.2009

I seem to have this irritating problem, when people writes a long /me it just cuts the rest off if the sentence the person wrote is too long, how can i make so it just continues? Like it makes 2 lines if he has such a long /me
here is the code :
Код:
 	if(strcmp(cmd, "/me", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			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_WHITE, "[Usage] /me [action]");
				return 1;
			}
			if(PlayerInfo[playerid][pMaskuse] == 1)
			{
			  format(string, sizeof(string), "Stranger %s", result);
			}
			else
			{
				format(string, sizeof(string), "%s %s", GetPlayerNameEx(playerid), result);
			}
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		return 1;
	}
Thanks, it works
Would be cooler if it skipped down one line and continued writing so it wouldn't fill the half screen but its awesome, thanks !


Re: Help with making text longer - Correlli - 30.12.2009

Change:
pawn Код:
new result[64];
to:
pawn Код:
new result[128];



Re: Help with making text longer - jameskmonger - 30.12.2009

He wants it to be like this:

Instead of if they type
Quote:

/me types a really long sentence and it takes up a lot of space because it's a long sentence so it takes up a lot of space.

Instead of saying
Quote:

PlayerName types a really long sentence and it takes up a lot of space because it's a long sentence so it takes up a lot of space.

It would say
Quote:

PlayerName types a really long sentence and it takes up a lot of space because...
it's a long sentence so it takes up a lot of space.




Re: Help with making text longer - Mike Garber - 30.12.2009

Quote:
Originally Posted by jameskmonger
He wants it to be like this:

Instead of if they type
Quote:

/me types a really long sentence and it takes up a lot of space because it's a long sentence so it takes up a lot of space.

Instead of saying
Quote:

PlayerName types a really long sentence and it takes up a lot of space because it's a long sentence so it takes up a lot of space.

It would say
Quote:

PlayerName types a really long sentence and it takes up a lot of space because...
it's a long sentence so it takes up a lot of space.

No... What he means Is;

Код:
* Mike Garber types a really long sentence and it takes up alot of space so It will not show up If he use what he had from the beginning.
Becomes
Код:
PlayerName types a really long sentence and it takes up alot of space so It
Now, If he does what Don said, It will show the whole message.


Re: Help with making text longer - jameskmonger - 31.12.2009

I said that he WANTED what I said.