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

(A little bit) Advanced Calculator


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Mario AR.
Senior Member
Join Date: May 2011
Location: Lima, Perú
Old 02-04-2014 , 13:10   (A little bit) Advanced Calculator
Reply With Quote #1

Hello. This plugin is just a calculator. It may look useless but is fun You can play with the numbers while waiting until next round (Specially if you're in a 32-slot server and you died early)

Command:
- Say /calc to open the calculator. Say_team is also supported.

Cvars:
- calculator_enable <1|0> - Enables/disables the plugin.
- calculator_message <1|0> - Enables/disables a message shown to players after connect.
- calculator_text_only_admins <1|0> - 1: Only admins can use the text mode. 0: Everyone can use the text mode.

Text mode instructions:
- Only +, -, *, /
- Use substractions instead of negative numbers (1 - 9 instead of -
- No support for parenthesis.
- Operation example: 5 * 3 - 16 / 2, Result: 7

Code:
About the calculator:
- Text mode support.
- Support for addition, substraction, multiplication, division and exponentiation.
- As exponentiation is a relatively complex operation, exponent is limited to 2 digits, 1 digit when the base is > 10
- Support for decimals (up to 3 in factors, 6 in the result), negative numbers.
- Multilanguage support.
- Should work for all mods.
- No print_chat, everything is shown in the calculator menu.
Special thanks to:
- Sylwester for his chat mode algorithm: http://forums.alliedmods.net/showthread.php?p=1613597
- ANTICHRISTUS for his French translation.
- OciXCrom for his Macedonian translation.

Suggestions are welcome!

PD: Doy soporte en español
Attached Files
File Type: sma Get Plugin or Get Source (calculator.sma - 951 views - 10.2 KB)
File Type: txt calculator.txt (1.3 KB, 170 views)

Last edited by Mario AR.; 02-08-2014 at 17:10. Reason: Update: Support for text mode
Mario AR. is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 02-04-2014 , 14:45   Re: (A little bit) Advanced Calculator
Reply With Quote #2

Looks... neat.
__________________
Kia is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 02-04-2014 , 15:22   Re: (A little bit) Advanced Calculator
Reply With Quote #3

-Does it calculates natural logarithmes? (ln(x))
-Does it calculates limits? (http://en.wikipedia.org/wiki/Limit_(mathematics))
-Does it calculates sin, cos, tan?

I think that a calculator called advanced if it will can calculate those functions.

Also add support for mathematical processes like ((20^3)/(10^(-5)))*(25^(31/17)) and the user will write something like that, and the calculator will print the result.

Those are some suggestions to you.

Good job anyway ;)
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
bibu
Veteran Member
Join Date: Sep 2010
Old 02-04-2014 , 17:07   Re: (A little bit) Advanced Calculator
Reply With Quote #4

Good job, though I saw somewhere like this already.

Btw, you should use PCVars.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Mario AR.
Senior Member
Join Date: May 2011
Location: Lima, Perú
Old 02-04-2014 , 20:02   Re: (A little bit) Advanced Calculator
Reply With Quote #5

Quote:
Originally Posted by Kia View Post
Looks... neat.
Thank you

Quote:
Originally Posted by oxygen935 View Post
-Does it calculates natural logarithmes? (ln(x))
-Does it calculates limits? (http://en.wikipedia.org/wiki/Limit_(mathematics))
-Does it calculates sin, cos, tan?

I think that a calculator called advanced if it will can calculate those functions.

Also add support for mathematical processes like ((20^3)/(10^(-5)))*(25^(31/17)) and the user will write something like that, and the calculator will print the result.

Those are some suggestions to you.

Good job anyway ;)
That's exaclty why the tag A little bit, haha, with Advanced I meant a better, user friendly calculator, the only calculator that I've found for AMXX does not support decimal numbers, either negatives!

Well, just for you, see the attachments here, this version includes a scientific mode with all the functions you want. I don't hope it will work, but try
(put scientific_calculator.txt in your mod root directory, is shown as a MOTD)

Quote:
Originally Posted by bibu View Post
Good job, though I saw somewhere like this already.
Well, this is kinda different.
Quote:
Originally Posted by bibu View Post
Btw, you should use PCVars.
Updated in main thread
Attached Files
File Type: sma Get Plugin or Get Source (calculator.sma - 932 views - 7.7 KB)
File Type: txt calculator.txt (1.4 KB, 174 views)
File Type: txt scientific_calculator.txt (38 Bytes, 272 views)
Mario AR. is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 02-05-2014 , 09:30   Re: (A little bit) Advanced Calculator
Reply With Quote #6

Quote:
Originally Posted by oxygen935 View Post
Also add support for mathematical processes like ((20^3)/(10^(-5)))*(25^(31/17)) and the user will write something like that, and the calculator will print the result.
That would be really useful, no doubt. I need it everyday in my CS server.
Why not a graphical calculator? You could print the functions in a MOTD window. I'm anxious for that.

Last edited by guipatinador; 02-05-2014 at 09:33.
guipatinador is offline
Mario AR.
Senior Member
Join Date: May 2011
Location: Lima, Perú
Old 02-06-2014 , 01:31   Re: (A little bit) Advanced Calculator
Reply With Quote #7

Quote:
Originally Posted by guipatinador View Post
That would be really useful, no doubt. I need it everyday in my CS server.
Why not a graphical calculator? You could print the functions in a MOTD window. I'm anxious for that.
Working in it
EDIT: Impossible :'(

Last edited by Mario AR.; 07-09-2014 at 06:48.
Mario AR. 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 12:18.


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