Help with making text longer
#1

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 !
Reply
#2

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

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.

Reply
#4

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.
Reply
#5

I said that he WANTED what I said.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)