08.09.2016, 08:21
Hello.
I'm trying to fix the string size, that the message that exteeds a certain limit, gets put into the next line, if that makes sense.
But it doesn't work.
This is my code:
(what i'm talking about is after the if(playerid[playerid][Admin]).
This is what currently happends:
I'm trying to fix the string size, that the message that exteeds a certain limit, gets put into the next line, if that makes sense.
But it doesn't work.
This is my code:
PHP код:
* ============================================================================ */
COMMAND:s(playerid,params[])
{
if(!Player[playerid][Authed]) return SendClientError(playerid, "You are not authed!");
if(!Player[playerid][Admin] && !Player[playerid][Helper]) return SendClientError(playerid,"You are not authorized to use this command!");
new message[164],string[200],string2[100];
if(sscanf(params, "s", message)) return SendClientUsage(playerid, "/s [message]");
IRC_GroupSay(Group, "#staff", sprintf("(Staff Chat) %s %s: %s ", getAdminName(playerid),RPName(playerid),message));
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(Player[i][Admin])
{
format(string,sizeof(string),"{FF0000}(Staff Chat) {D4D4D4}%s %s: {FFFFFF}%s",getAdminName(playerid),RPName(playerid),message);
SendClientMessage(i,-1,sprintf("%i",strlen(string)));
if(strlen(string) >= 97)
{
strmid(string2, string, 96, 256);
strdel(string, 96, 256);
SendClientMessage(i, -1, string);
SendClientMessage(i, -1, string2);
}
else SendClientMessage(i, -1, string);
}
else if(Player[i][Helper])
{
SendMessageToPlayer(i,-1,sprintf("{FF0000}(Staff Chat) {D4D4D4}%s %s: {FFFFFF}%s",getAdminName(playerid),RPName(playerid),message),110);
}
}
return 1;
}
/* ============================================================================= */
This is what currently happends: