Problem with string sizes
#1

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:
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 
0GetPlayerPoolSize(); <= ji++)
       {
           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(string2string96256);
            
strdel(string96256);
            
SendClientMessage(i, -1string);
            
SendClientMessage(i, -1string2);
        }     
        else 
SendClientMessage(i, -1string);
        }    
            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;
}
/* ============================================================================= */ 
(what i'm talking about is after the if(playerid[playerid][Admin]).
This is what currently happends:

Reply


Messages In This Thread
Problem with string sizes - by justjamie - 08.09.2016, 08:21
Re: Problem with string sizes - by TORKQ - 08.09.2016, 11:00
Re: Problem with string sizes - by justjamie - 08.09.2016, 13:44
Re: Problem with string sizes - by justjamie - 09.09.2016, 09:31
Re: Problem with string sizes - by zT KiNgKoNg - 09.09.2016, 10:17
Re: Problem with string sizes - by justjamie - 10.09.2016, 17:10
Re: Problem with string sizes - by Tass007 - 11.09.2016, 05:44
Re: Problem with string sizes - by SickAttack - 11.09.2016, 07:03
Re: Problem with string sizes - by justjamie - 11.09.2016, 10:24
Re: Problem with string sizes - by FreAkeD - 11.09.2016, 10:36

Forum Jump:


Users browsing this thread: 2 Guest(s)