format text[]
#1

pawn Код:
public OnPlayerText(playerid, text[])
{
    format(text, 128, "Some new text");
    printf("[CHAT] %s", text);
    return 1;
}
it print "Some ", "Some n" but not the whole text, why?

dont ask why i need this
Reply
#2

Why not just leave it like this? And are you declaring the variable text as text[128]?
pawn Код:
public OnPlayerText(playerid, text[])
{
    printf("[CHAT] %s", text);
    return 1;
}
Reply
#3

Why do you use format if you're not actually formatting any text into it? Also, since you don't pass any parameters, that may be the problem.
pawn Код:
public OnPlayerText( playerid, text[ ] )
{
   text[ 0 ] = EOS;
   strcat( text, "Some new text" );
   printf( "[CHAT] %s", text );
   return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)