Format for Player Info? - 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 for Player Info? (
/showthread.php?tid=608087)
Format for Player Info? -
Luicy. - 27.05.2016
Can I use this?
PHP Code:
format(Player[playerid][pPassword], 128, "%s", inputtext);
Will this save the inputtext to that variable?
Re: Format for Player Info? -
justjamie - 27.05.2016
yes it will
Re: Format for Player Info? -
Luicy. - 27.05.2016
Edit: Thanks ^
Re: Format for Player Info? -
SyS - 27.05.2016
it does
Re: Format for Player Info? -
Luicy. - 27.05.2016
Okay, thanks.
Re: Format for Player Info? -
F1N4L - 27.05.2016
Format is slow in this case, use strcat:
Code:
strcat(Player[playerid][pPassword], inputtext);
Re: Format for Player Info? -
Konstantinos - 27.05.2016
Quote:
Originally Posted by F1N4L
Format is slow in this case, use strcat:
Code:
strcat(Player[playerid][pPassword], inputtext);
|
Indeed strcat is recommended but you need to clear the destination before because it will "join" the strings and also specify the max size for it.
pawn Code:
#if !defined strcpy
#define strcpy(%0,%1) strcat((%0[0] = EOS, %0), %1)
#endif
and:
pawn Code:
strcpy(Player[playerid][pPassword], inputtext, 128);
Re: Format for Player Info? -
Luicy. - 27.05.2016
Okay Thanks, is it possibe to rename strcpy to OverWrite(..)?
like, just changing strcpy or it has to be named strcpy?
Re: Format for Player Info? -
Sew_Sumi - 27.05.2016
Quote:
Originally Posted by Meller
Okay Thanks, is it possibe to rename strcpy to OverWrite(..)?
like, just changing strcpy or it has to be named strcpy?
|
Better to stick to the standard so you and everyone else, knows what you are looking at.
Re: Format for Player Info? -
Stinged - 27.05.2016
You can change it to OverWrite.