Raised This Month: $ Target: $400
 0% 

Solved need help in optimization [weird coding]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 01-20-2022 , 10:57   Re: need help in optimization [weird coding]
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
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 View Post
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 View Post
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 View Post
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?
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951

Last edited by kww; 01-20-2022 at 11:03.
kww is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode