SA-MP Forums Archive
format text[] - 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: format text[] (/showthread.php?tid=279191)



format text[] - Unknown123 - 25.08.2011

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


Re: format text[] - Backwardsman97 - 25.08.2011

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;
}



Re: format text[] - Bakr - 26.08.2011

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;
}