My text is too short? - 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: My text is too short? (
/showthread.php?tid=266984)
My text is too short? -
Outcast - 06.07.2011
This is a problem on all of my commands. I type in something long, that should be 100-200 character, but the server shows me the result in short, like only the first 50 or characters. What's wrong here?
pawn Код:
CMD:o(playerid, params[350])
{
new text[371];
if(sscanf(params, "%s", params)) return SendClientMessage(playerid, USAGE_COLOR, "Usage: /s [Global OOC]");
format(text, sizeof(text), "> [OOC] %s: (( %s ))",pName[playerid], params);
SendClientMessageToAll(GOOC_COLOR, text);
return 1;
}
Also, when player types in normal chat, if he types too long of a line, the message won't show up. I want it to show the message, and if it's too long it should show the characters that are over the limit cut off, missing.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(!pLoggedIn[playerid]) return 1;
new chat[371];
format(chat, sizeof(chat), "%s Says: %s", pName[playerid], text);
ProxDetector(17.0, playerid, chat, LCHAT1_COLOR, LCHAT2_COLOR, LCHAT3_COLOR, LCHAT4_COLOR, LCHAT5_COLOR);
return 0;
}
Re: My text is too short? -
Outcast - 06.07.2011
It works, but now if the text is too long, the message won't show up.
Re: My text is too short? -
BigETI - 06.07.2011
pawn Код:
CMD:o(playerid, params[])
{
if(!pLoggedIn[playerid]) return 0;
new input[128];
if(sscanf(params, "s[128]", input)) return SendClientMessage(playerid, USAGE_COLOR, "Usage: /s [Global OOC]");
if(!sscanf(params, "s[128]", input))
{
new text[129];
format(text, sizeof(text), "> [OOC] %s: (( %s ))", pName[playerid], input);
if(strlen(text > 128)) return SendClientMessage(playerid, 0xFF0000, "Your text is too long to show. Try to resize your text.");
SendClientMessageToAll(GOOC_COLOR, text);
}
return 1;
}
Re: My text is too short? -
Outcast - 06.07.2011
Okay, it works now. I've got one more question. How can I remove that global chat? Whenever I type something into regular chat, I get a local chat message displayed and a global chat message (2 messages instead of one). So, how to disable global chat?
Re: My text is too short? -
Shadoww5 - 06.07.2011
https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius
Re: My text is too short? -
=WoR=Varth - 07.07.2011
If you return 0 your OnPlayerChat the global chat shouldn't appear.
Re: My text is too short? -
Outcast - 07.07.2011
Yes, it works now. Thanks all.