Format for Player Info?
#1

Can I use this?
PHP Code:
format(Player[playerid][pPassword], 128"%s"inputtext); 
Will this save the inputtext to that variable?
Reply
#2

yes it will
Reply
#3

Edit: Thanks ^
Reply
#4

it does
Reply
#5

Okay, thanks.
Reply
#6

Format is slow in this case, use strcat:
Code:
strcat(Player[playerid][pPassword], inputtext);
Reply
#7

Quote:
Originally Posted by F1N4L
View Post
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);
Reply
#8

Okay Thanks, is it possibe to rename strcpy to OverWrite(..)?
like, just changing strcpy or it has to be named strcpy?
Reply
#9

Quote:
Originally Posted by Meller
View Post
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.
Reply
#10

You can change it to OverWrite.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)