Bug Admin
#4

Sorry, I'll give you an example with the differences between the strcat and format functions

PHP код:
format(string,sizeof string,"1");
format(string,sizeof string,"2");
format(string,sizeof string,"3");
printf("String: %s",string); 
The code above will output 'String: 3'. Not really what we want to accomplish in this case. However:

PHP код:
strcat(string,"1");
strcat(string,"2");
strcat(string,"3");
printf("String: %s",string); 
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:

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 
I don't know why but I think i'm only making this harder to understand.
Reply


Messages In This Thread
Bug Admin - by Loinal - 07.04.2017, 08:44
Re: Bug Admin - by Toroi - 07.04.2017, 09:00
Re: Bug Admin - by Loinal - 07.04.2017, 09:08
Re: Bug Admin - by Toroi - 07.04.2017, 09:17
Re: Bug Admin - by Loinal - 07.04.2017, 09:20
Re: Bug Admin - by Toroi - 07.04.2017, 09:32
Re: Bug Admin - by Loinal - 08.04.2017, 08:25
Re: Bug Admin - by denNorske - 08.04.2017, 08:53
Re: Bug Admin - by Loinal - 08.04.2017, 10:02
Re: Bug Admin - by denNorske - 08.04.2017, 10:04

Forum Jump:


Users browsing this thread: 2 Guest(s)