String size not properly working.
#1

Код:
CMD:pm(playerid, params[])
{
	new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
	if(sscanf(params, "us", id, str2))
	{
	    SendClientMessage(playerid, 0xDDBD0BFF, "Usage: /pm <id> <message>");
	    return 1;
	}
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xDDBD0BFF, "ERROR: Player not connected");
	if(playerid == id) return SendClientMessage(playerid, 0xDDBD0BFF, "ERROR: You cannot pm yourself!");
	{
		GetPlayerName(playerid, Name1, sizeof(Name1));
		GetPlayerName(id, Name2, sizeof(Name2));
		format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
		SendClientMessage(playerid, 0xDDBD0BFF, str);
		format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
		SendClientMessage(id, 0xC0A50AFF, str);
	}
	return 1;
}
When players send PM's to each other, the string is cut off very early (probably like 50-60 characters in) when they type a long PM.

Did I do something incorrectly?
Reply


Messages In This Thread
String size not properly working. - by Sebz - 20.12.2015, 14:38
Re: String size not properly working. - by JeaSon - 20.12.2015, 14:46
Re: String size not properly working. - by prineside - 20.12.2015, 14:51

Forum Jump:


Users browsing this thread: 1 Guest(s)