07.04.2017, 09:17
Sorry, I'll give you an example with the differences between the strcat and format functions
The code above will output 'String: 3'. Not really what we want to accomplish in this case. However:
Will output 'String: 123'. Which is exactly what you need in order to display the administrators online.
In this case you'd want to create a new string variable with a considerable size and add your already formatted string to that new string with the use of strcat. Like this:
I don't know why but I think i'm only making this harder to understand.
PHP код:
format(string,sizeof string,"1");
format(string,sizeof string,"2");
format(string,sizeof string,"3");
printf("String: %s",string);
PHP код:
strcat(string,"1");
strcat(string,"2");
strcat(string,"3");
printf("String: %s",string);
In this case you'd want to create a new string variable with a considerable size and add your already formatted string to that new string with the use of strcat. Like this:
PHP код:
format(string2,sizeof string,"1");
strcat(string,string2);
format(string2,sizeof string,"2");
strcat(string,string2);
format(string2,sizeof string,"3");
strcat(string,string2);
printf("String: %s",string); // will output String: 123