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

Admin Logs 1.2


Post New Thread Reply   
 
Thread Tools Display Modes
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 11-11-2009 , 02:41   Re: Admin Logs 0.2
Reply With Quote #11

Pointless plugin but oh well...

Instead of...

PHP Code:
new arg1[64]
new 
arg2[64]
new 
arg3[64]
new 
arg4[64]
new 
arg5[64]
new 
arg6[64]

read_arg(1arg163)
...
format(string,499,"[%s] used command %s %s %s %s %s %s %s",s_Time,pCommand,arg1,arg2,arg3,arg4,arg5,arg6
-->
PHP Code:
new arg[6][64]

read_arg(1arg[0], 63)
read_arg(2arg[1], 63)
...
format(string499"[%s] used command %s %s %s %s %s %s %s"s_TimepCommandarg[0], arg[1], arg[2], arg[3], arg[4], arg[5]) 
Doesn't do anything for performance but frees up some code.

Instead of using...

PHP Code:
format() 
-->
PHP Code:
formatex() 
formatex() is faster than format().

PHP Code:
if( containi(pCommand"amx_") != -&& (  get_user_flags(id) && ACCESS ) ) 
-->
PHP Code:
if( containi(pCommand"amx_") != -&& ( get_user_flags(id) & ACCESS ) ) 
&& should be &.

You really need to clean up your code. Read up on this.

http://forums.alliedmods.net/showthread.php?t=85274
shadow.hk is offline
Send a message via MSN to shadow.hk
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 11-11-2009 , 02:58   Re: Admin Logs 0.2
Reply With Quote #12

Similar than this: http://forums.alliedmods.net/showthread.php?p=66648
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
pirvu
Senior Member
Join Date: Apr 2009
Location: Here and There [ro]
Old 11-11-2009 , 03:17   Re: Admin Logs 0.2
Reply With Quote #13

1. I don't see why i should use a matrix instead of 6 vectors ..
It's not an optimization at all .. Nvm

2. I'll try your idea with formatex, thanks

3. & - is the "And" on bytes ...

As i sayd i am not a good amxx scripter so i don't know all funcitons ..

I saw in lots of plugins the code you're talking about but i never understood why . If you can explain that to me , i will be grateful ..

Whenever i need to code something i think first about the performance and after that about the code aspect ...

Usually when i work in C++ i have a function for each 20-30 lines of coding ..

So i work with lots of functions and the code is clean ..
But in Amxx i don't see why i should do that ..

Thanks for your opinion ;)
__________________
Http://pirvu.mybrute.com <- Try my BRUTE! If you dare!
pirvu is offline
Send a message via Yahoo to pirvu Send a message via Skype™ to pirvu
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 11-11-2009 , 05:52   Re: Admin Logs 0.2
Reply With Quote #14

Quote:
Originally Posted by shadow.hk View Post
&& should be &.
__________________
I am out of order!
grimvh2 is offline
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 11-11-2009 , 05:55   Re: Admin Logs 0.2
Reply With Quote #15

Quote:
1. I don't see why i should use a matrix instead of 6 vectors ..
It's not an optimization at all .. Nvm
I never said it did much of anything, it just frees up 5 lines in your code.

Quote:
3. & - is the "And" on bytes ...
If you're saying that you did nothing wrong there, read it again.
PHP Code:
get_user_flags(id) && ACCESS 
should've been...
PHP Code:
get_user_flags(id) & ACCESS 
Quote:
I saw in lots of plugins the code you're talking about but i never understood why . If you can explain that to me , i will be grateful ..
If that was for me, could you be a bit more specific. I'll gladly help where I can
shadow.hk is offline
Send a message via MSN to shadow.hk
pirvu
Senior Member
Join Date: Apr 2009
Location: Here and There [ro]
Old 11-11-2009 , 13:30   Re: Admin Logs 0.2
Reply With Quote #16

Quote:
Originally Posted by shadow.hk View Post
If that was for me, could you be a bit more specific. I'll gladly help where I can
Yeah it was for you , and i was inviting you to explain to me why it should be & instead of && ...

After reading on wikipedia i found this :
Code:
In the C programming language family, the bitwise AND operator is "&" (ampersand). 
Again, this operator must not be confused with its Boolean "logical and" counterpart, 
which treats its operands as Boolean values, and is written "&&" (two ampersands).
which i already knew ..

My question for you is what does the function get_user_flags(id) return ?
__________________
Http://pirvu.mybrute.com <- Try my BRUTE! If you dare!
pirvu is offline
Send a message via Yahoo to pirvu Send a message via Skype™ to pirvu
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-11-2009 , 23:28   Re: Admin Logs 0.2
Reply With Quote #17

Look for yourself on the funcwiki... I know that shit off the top of my head.. you should too..
Styles is offline
Send a message via AIM to Styles
pirvu
Senior Member
Join Date: Apr 2009
Location: Here and There [ro]
Old 11-12-2009 , 01:46   Re: Admin Logs 0.2
Reply With Quote #18

Quote:
Originally Posted by styles View Post
Look for yourself on the funcwiki... I know that shit off the top of my head.. you should too..
Yeah but
1. i have a life
2. i'll better work on C++ to learn algorithms than cs functions ...
__________________
Http://pirvu.mybrute.com <- Try my BRUTE! If you dare!
pirvu is offline
Send a message via Yahoo to pirvu Send a message via Skype™ to pirvu
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 11-12-2009 , 01:47   Re: Admin Logs 0.2
Reply With Quote #19

Quote:
Originally Posted by pirvu View Post
2. i'll better work on C++ to learn algorithms than cs functions ...
Then why are you even writing AMXX scripts?
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
pirvu
Senior Member
Join Date: Apr 2009
Location: Here and There [ro]
Old 11-12-2009 , 01:51   Re: Admin Logs 0.2
Reply With Quote #20

Quote:
Originally Posted by DarkGod View Post
Then why are you even writing AMXX scripts?
Can't a man be bored ?

I had a cs server .. and i made some plugins for it ... :-? and i thought i'll better post this plugin , maybe someone will need it .. because it's very handy..

For example some1 comes to you and tells you yesterday admin BLABLA gave himself noclip ,etc ..

You just go in the folder of date , then on the adminname.log , and there you search the hour /etc ..

If you guys don't need it , it's not my problem .
__________________
Http://pirvu.mybrute.com <- Try my BRUTE! If you dare!
pirvu is offline
Send a message via Yahoo to pirvu Send a message via Skype™ to pirvu
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 19:50.


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