Splitting a string into two parts, and then combining them again
#1

pawn Код:
CMD:pager ( playerid, params[] )
{
    new
        text [ 64 ];
       
    if( sscanf( params, "s[64]", text ) )
        return false;
       
       
    new
        pStr [ 128 ],
        pStr_Extracted [ 128 ];
       
    if( strlen ( text ) <= 57 )
    {
        format( pStr, 128, "PAGER: ~w~%s", text );
    }
    else
    {
        format( pStr, 128, "PAGER: ~w~%s~n~\t\t..", text );
        printf( pStr );
       
        strmid ( pStr_Extracted, pStr, 57, strlen ( pStr ) );
        printf( pStr_Extracted );
        strcat ( pStr, pStr_Extracted, 128 );
    }
       
    PlayerTextDrawHide ( playerid, Pager [ playerid ] );
    PlayerTextDrawSetString ( playerid, Pager [ playerid ], pStr );
    PlayerTextDrawShow( playerid, Pager [ playerid ] );
    return true;
}
Currently I've got this, and it repeats the "pStr_Extracted" back, what's wrong?

Picture for a better explaination:
Reply


Messages In This Thread
Splitting a string into two parts, and then combining them again - by 2KY - 14.03.2013, 20:42
Re: Splitting a string into two parts, and then combining them again - by Vince - 14.03.2013, 20:56
Re: Splitting a string into two parts, and then combining them again - by 2KY - 14.03.2013, 20:58

Forum Jump:


Users browsing this thread: 2 Guest(s)