String cutoff
#1

Hello there,

I have a problem where a faction name gets cut off in the chat, for instance, instead of "San Andreas Police Department", I get "San Andreas Police Depa". It is cut off everywhere, on dialogs, on /fadvert command... didn't see an occasion where it worked. I've read something about this, and I've increased FactionName string from 256 to 512 and I've tried the maximum of 1024 too, but none of these fixed the issue.

Код:
enum FactionData
{
	FactionName[512],
        ... // other stuff
};
Posting a bit of my /fadvert command

Код:
	    if(Player[playerid][FactionRank] >= 4)
	    {
			new message[128], string[256];
			if(sscanf(params, "s[128]", message))
			{
				SendClientMessage(playerid, WHITE, "Server: /fadvert [advertisement]");
				SendClientMessage(playerid, GREY, "Example: '/fadvert Here to save your lives everyday.'");
				SendClientMessage(playerid, GREY, "You will see: [FACTION ADVERT] Call 911 for any immediate reports on problems or crimes committed. [San Andreas Police Department]");
			}
			else
			{
			    format(string, sizeof(string), "[FACTION ADVERT] %s [%s]", message, Factions[Player[playerid][Faction]][FactionName]);
			    SendClientMessageToAll(ADVERT, string);
			}
		}
Reply
#2

put your string for third message upto 600
Reply
#3

I don't think that's going to work, but I'll have a try. The /fadvert string is really long, I spammed a bit of random letters into it, and it didn't cut off. The thing is that FactionName is cut off everywhere in the script. Any suggestions?
Reply
#4

well set a max in the info and if it goes over that ammount send clientmessage(playerid,-1,"sorry you when't over the max limit sorry your advert could't be published");
Reply
#5

Thanks for your help, but you're misunderstanding me. The advert is not the problem, the string of the FactionName gets cut off.
Reply
#6

yes change string[256]; to string[500]; your string is too short since its 256 your message is taking over the name so put a limit on the message its self
Reply
#7

I did that, and the result is still the same. Here's a picture, speaks a thousand words... :P

Reply
#8

LOL. samp's chat only holds so much thats why i said put a cap on the ammount
Reply
#9

try moving the name and message around
Reply
#10

Actually, I'm pretty sure according to the limits page it holds 1024. I got this. What else should I change?

Код:
new message[128], string[500];
if(sscanf(params, "s[128]", message))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)