strcat not working
#1

trying to replace hInfo[house][safec] by inputtext, this is the code:
Код:
strcat(hInfo[house][safec], inputtext);
format(result, sizeof(result), "You've changed safe house code to: "#COL_YELLOW"%s. "#COL_WHITE"Please save it.", hInfo[house][safec]);
In game, it's showing me "to: 0000 (The old [safec] value)", so the strcat didn't work. What's wrong with the code?
Reply
#2

I would use format instead of strcat, like so:
Код:
format(hInfo[house][safec], sizeof(hInfo[house][safec]), inputtext);
format(result, sizeof(result), "You've changed safe house code to: "#COL_YELLOW"%s. "#COL_WHITE"Please save it.", hInfo[house][safec]);
Reply
#3

thanks, it worked with format.
Reply
#4

PHP код:
sizeof (hInfo[house][safec]) 
Is 1 for enum - use

PHP код:
strcat(hInfo[house][safec], inputtext32); 
Or some other size.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)