PDA

View Full Version : Messages realy short =s


Stefans94
08/10/2011, 09:33 PM
Hello all,

I'm trying to make an ooc chat (yeah by myself because i learn from doing things by myself XD)
now the problem was the if you typed like ffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffffffffffffff
it only showed like: ffffffffffffffffffffffffffffffffffffffff
so i made it much bigger but it stays the same..
the messages are really really really short..


CMD:o(playerid, params[]) {
if(OOC == true) {
new message[400], pname[MAX_PLAYER_NAME], cmessage[500];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(params, "s", message)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /o (message)");
format(cmessage, sizeof(cmessage), "(( OOC: %s: %s ))", pname, message);
SendClientMessageToAll(COLOR_GREY, cmessage);
} else {
SendClientMessage(playerid, COLOR_GREY, "SERVER: The OOC chat is turned off.");
}
return 1;
}


help me please =)

mitosking
08/10/2011, 09:35 PM
New command:

CMD:o(playerid, params[]) {
if(OOC == true) {
new message[128], pname[MAX_PLAYER_NAME], cmessage[128];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /o (message)");
format(cmessage, sizeof(cmessage), "(( OOC: %s: %s ))", pname, message);
SendClientMessageToAll(COLOR_GREY, cmessage);
} else {
SendClientMessage(playerid, COLOR_GREY, "SERVER: The OOC chat is turned off.");
}
return 1;
}

Try it ;).

Jafet_Macario
08/10/2011, 09:42 PM
You don't even need to use sscanf.
CMD:o(playerid, params[])
{
new string[128], pname[MAX_PLAYER_NAME];
if(OOC == false) return SendClientMessage(playerid, COLOR_GREY, "SERVER: The OOC chat is turned off.");
if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /o (message)");
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "(( OOC: %s: %s ))", pname, params);
SendClientMessageToAll(COLOR_GREY, string);
return 1;
}

Stefans94
08/10/2011, 09:48 PM
thanks=)