SA-MP Forums Archive
[HELP] To small space to type - 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] To small space to type (/showthread.php?tid=130544)



[HELP] To small space to type - FreddeN - 27.02.2010

On my /ooc and /b command etc players can only type about BlahBlah characters and it will be cutted in half and they have to type again to continue.

I've seen on other scripts that if you type to long, it will change row and you can type how much you want (almost).

Here is my OOC script, we can work from that:

Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(IsLogged[playerid] == 0)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "	You are not logged in yet.");
	      return 1;
	    }
			if(noooc == 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "	The OOC channel has been disabled by an admin.");
				return 1;
			}
			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_GREY, "	USAGE: (/o)oc [text]");
				return 1;
			}
			format(string, sizeof(string), "(( [OOC] %s: %s ))", sendername, result);
			SendClientMessageToAll(COLOR_WHITE,string);
		}
		return 1;
	}
Thanks for the help


Re: [HELP] To small space to type - Eazy_Efolife - 27.02.2010

Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(IsLogged[playerid] == 0)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "	You are not logged in yet.");
	      return 1;
	    }
			if(noooc == 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "	The OOC channel has been disabled by an admin.");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[256];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GREY, "	USAGE: (/o)oc [text]");
				return 1;
			}
			format(string, sizeof(string), "(( [OOC] %s: %s ))", sendername, result);
			SendClientMessageToAll(COLOR_WHITE,string);
		}
		return 1;
	}
Try that.


Re: [HELP] To small space to type - FreddeN - 27.02.2010

Quote:
Originally Posted by Eric_
Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(IsLogged[playerid] == 0)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "	You are not logged in yet.");
	      return 1;
	    }
			if(noooc == 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "	The OOC channel has been disabled by an admin.");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[256];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GREY, "	USAGE: (/o)oc [text]");
				return 1;
			}
			format(string, sizeof(string), "(( [OOC] %s: %s ))", sendername, result);
			SendClientMessageToAll(COLOR_WHITE,string);
		}
		return 1;
	}
Try that.
Thanks