Raised This Month: $51 Target: $400
 12% 

Question about register_plugin


Post New Thread Reply   
 
Thread Tools Display Modes
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-09-2018 , 15:53   Re: Question about register_plugin
Reply With Quote #11

In the end, it doesn't even matter.
__________________
klippy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-09-2018 , 15:53   Re: Question about register_plugin
Reply With Quote #12

Stop over thinking, it doesn't matter.
__________________
HamletEagle is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-09-2018 , 15:59   Re: Question about register_plugin
Reply With Quote #13

So, I can use anything with get_players & for(new i=0......); ?

PHP Code:
new players[32]....
....
for(new 
i=0i<inumi++) {
        
player players[i];

       
set_pev(playerpev_healthFloat:pev(player_health) + 1.0);

If so, I mean I am dealing nothing important things...
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-09-2018 , 16:00   Re: Question about register_plugin
Reply With Quote #14

Well in my test first one was 2x faster than second and 2.5x faster than 3rd
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-09-2018 , 16:17   Re: Question about register_plugin
Reply With Quote #15

Quote:
Originally Posted by Ghosted View Post
Well in my test first one was 2x faster than second and 2.5x faster than 3rd
Did you test it with get_players and for(new.....)? or just in call per once?
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-09-2018 , 16:27   Re: Question about register_plugin
Reply With Quote #16

Quote:
Originally Posted by PurposeLessx View Post
Did you test it with get_players and for(new.....)? or just in call per once?
No just looped what u typed (about setting health) three of them (each one 32768000 times) 9 times and results were same all time. And also i used C++ .

EDIT:

Also tested in AMXX and in speed 1 > 2 > 3 but difference is not much
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 08-09-2018 at 17:20.
Ghosted is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-09-2018 , 18:08   Re: Question about register_plugin
Reply With Quote #17

Store values in variables only if they're used more than once. That's it.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-10-2018 , 03:38   Re: Question about register_plugin
Reply With Quote #18

Quote:
Originally Posted by OciXCrom View Post
Store values in variables only if they're used more than once. That's it.
I believe it's fine to use a variable even if the value is used one time, for readability.
Think about a pretty long native call inside another native call for example.
__________________
HamletEagle is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-10-2018 , 04:27   Re: Question about register_plugin
Reply With Quote #19

When it comes to performance it really comes down to reducing pawn-C++ interop, most of other stuff doesn't matter.
__________________
klippy is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-10-2018 , 04:33   Re: Question about register_plugin
Reply With Quote #20

Quote:
Originally Posted by HamletEagle View Post
I believe it's fine to use a variable even if the value is used one time, for readability.
Think about a pretty long native call inside another native call for example.
May you give an example to use? I am not still pretty sure about what is it fine.
(My english is not good enough. I cannot understand, sorry my bad)
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx is offline
Reply



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 17:18.


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