SA-MP Forums Archive
Messages realy short =s - 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)
+--- Thread: Messages realy short =s (/showthread.php?tid=288739)



Messages realy short =s - Stefans94 - 08.10.2011

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..

pawn Код:
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 =)


Re: Messages realy short =s - mitosking - 08.10.2011

New command:

pawn Код:
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 .


Re: Messages realy short =s - Jafet_Macario - 08.10.2011

You don't even need to use sscanf.
pawn Код:
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;
}



Re: Messages realy short =s - Stefans94 - 08.10.2011

thanks=)