Raised This Month: $40 Target: $400
 10% 

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 , 16: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 , 16: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 , 16: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 , 17: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.6.3 (Report )(1.7 - 44%)
[MM] MetaMod-C V0.99B (Report )(1.0 - 43%)
Base Builder Module Vote For It
( Donate) ( Steam)
Ghosted is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-09-2018 , 17: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 , 17: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.6.3 (Report )(1.7 - 44%)
[MM] MetaMod-C V0.99B (Report )(1.0 - 43%)
Base Builder Module Vote For It
( Donate) ( Steam)

Last edited by Ghosted; 08-09-2018 at 18:20.
Ghosted is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-09-2018 , 19: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 , 04: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 , 05: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 , 05: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


Thread Tools
Display Modes

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 20:12.


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