Quote:
Originally Posted by HamletEagle
Reducing the code size shouldn't be your goal. Do you have a valid reason as to why you want to change the code? If not, leave it as it is.
|
Maybe you're right.
I had repeating code in some parts of a plugin so i decided to make one stock to call it. Now i just want to make it cleaner to look better. Or I shouldn't aim that?
Quote:
Originally Posted by Natsheh
Pass the string directly no need for reformatting...
PHP Code:
console_print(players[i], "%s", szOutput)
PHP Code:
console_print(players[i], szOutput)
|
Oh, thanks, i didn't notice it. Just ctrl+c then ctrl+v, sorry
Quote:
Originally Posted by Natsheh
Also no need for using loop to print for each individual player just use index as 0 for all and remove the loops.
|
agree
Quote:
Originally Posted by Natsheh
Also you can use bitsum values for print destination will be be more easy and reliable, same goes for notify type.
PHP Code:
enum _:ePrintDestination (<<=1) { PRINT_CHAT = 1, PRINT_CONSOLE }
|
Never understood bitsums and related things. Looks like it's worth digging into this thread.
UPD: Is the chat string limit is 192 symbols?
__________________